{"id":"CVE-2026-41507","published":"2026-05-08T13:49:34Z","modified":"2026-05-08T14:20:21Z","title":"Remote Code Execution (RCE) via String Literal Injection into math-codegen","vendor":"mauriciopoppe","product":"math-codegen","tier":"tail","description":{"text":"math-codegen generates code from mathematical expressions. Prior to version 0.4.3, string literal content passed to cg.parse() is injected verbatim into a new Function() body without sanitization. This allows an attacker to execute arbitrary system commands when user-controlled input reaches the parser. Any application exposing a math evaluation endpoint where user input flows into cg.parse() is vulnerable to full RCE. This issue has been patched in version 0.4.3.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00393,"percentile":0.34341,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/mauriciopoppe/math-codegen/security/advisories/GHSA-p6x5-p4xf-cc4r","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/mauriciopoppe/math-codegen/pull/11","tags":["x_refsource_MISC"]},{"url":"https://github.com/mauriciopoppe/math-codegen/commit/4bb52d3030683362b3559ee8dd91350555a05f6b","tags":["x_refsource_MISC"]}],"priority":{"score":13.7,"factors":[{"name":"EPSS percentile","points":6.87},{"name":"CVSS severity","points":6.86}]},"vendorSlug":"mauriciopoppe","affectedVersions":[{"vendor":"mauriciopoppe","product":"math-codegen","versions":["< 0.4.3"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"total","timestamp":"2026-05-08T14:20:14.868190Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"math-codegen","vulnerableRanges":["<0.4.3"],"patched":["0.4.3"],"from":["GHSA-p6x5-p4xf-cc4r"],"provenance":"source"}],"summary":{"text":"The math-codegen library from mauriciopoppe fails to sanitize string literal content passed to its cg.parse() function, which is injected verbatim into a new Function() body. An attacker who can get user-controlled input into cg.parse() can execute arbitrary system commands, with no authentication or user interaction required and network access sufficient for an exposed math evaluation endpoint.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:35:16Z"},"euvd":{"id":"EUVD-2026-28597","exploited":false,"provenance":"source"}}