# CVE-2026-41507: Remote Code Execution (RCE) via String Literal Injection into math-codegen

- Severity: Critical 9.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.67%, higher than 47% of CVEs (2026-11-30)
- Published: 2026-04-17T22:31:45.000Z
- Modified: 2026-10-26T19:10:00.163Z
- Also known as: GHSA-p6x5-p4xf-cc4r
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- mauriciopoppe math-codegen: < 0.4.3; before 0.4.3
- math-codegen (npm): before 0.4.3

## Every score

- GitHub_M: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/mauriciopoppe/math-codegen/security/advisories/GHSA-p6x5-p4xf-cc4r> (vendor-advisory, web)
- <https://github.com/mauriciopoppe/math-codegen/pull/11> (issue-tracking, web)
- <https://github.com/mauriciopoppe/math-codegen/commit/4bb52d3030683362b3559ee8dd91350555a05f6b> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-41507> (advisory)
- <https://github.com/hits3134> (web)
- <https://github.com/mauriciopoppe/math-codegen> (package)

## Sources

- CVE List: [CVE-2026-41507](https://www.cve.org/CVERecord?id=CVE-2026-41507), CVE Terms of Use, modified 2026-05-08
- GitHub Advisory Database: [GHSA-p6x5-p4xf-cc4r](https://github.com/advisories/GHSA-p6x5-p4xf-cc4r), CC-BY-4.0, modified 2026-05-12
- NVD: [CVE-2026-41507](https://nvd.nist.gov/vuln/detail/CVE-2026-41507), Public domain, modified 2026-10-26

---

Page: https://cve.day/CVE-2026-41507 · Whole record: https://cve.day/CVE-2026-41507.json · Rebuilt by cve.day 2026-11-25T22:59:20.971Z
