{"id":"CVE-2026-41507","summary":"Remote Code Execution (RCE) via String Literal Injection into math-codegen","details":"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.","aliases":["GHSA-p6x5-p4xf-cc4r"],"modified":"2026-07-08T08:13:15.825743341Z","published":"2026-05-08T13:49:34.091Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/41xxx/CVE-2026-41507.json","cwe_ids":["CWE-94"],"cna_assigner":"GitHub_M"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/41xxx/CVE-2026-41507.json"},{"type":"ADVISORY","url":"https://github.com/mauriciopoppe/math-codegen/security/advisories/GHSA-p6x5-p4xf-cc4r"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41507"},{"type":"FIX","url":"https://github.com/mauriciopoppe/math-codegen/commit/4bb52d3030683362b3559ee8dd91350555a05f6b"},{"type":"FIX","url":"https://github.com/mauriciopoppe/math-codegen/pull/11"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/mauriciopoppe/math-codegen","events":[{"introduced":"0"},{"fixed":"c8c47f823cf1365cd7ba5ebf9961a3aece2f3a54"},{"fixed":"4bb52d3030683362b3559ee8dd91350555a05f6b"}],"database_specific":{"extracted_events":[{"introduced":"0"},{"fixed":"0.4.3"}],"source":["CPE_RANGE","REFERENCES"],"cpe":"cpe:2.3:a:mauriciopoppe:math-codegen:*:*:*:*:*:*:*:*"}}],"versions":["v0.4.2","v0.4.0","v0.3.5","v0.3.4","v0.3.3","v0.3.2","v0.3.1","v0.3.0","v0.2.5","v0.2.4","v0.2.3","v0.2.2","v0.2.1","v0.2.0","v0.1.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-41507.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}]}