CVE-2026-41507Mauriciopoppe Math-codegen
Critical 9.8 No auth needed
Follow: this CVE · Mauriciopoppe · Mauriciopoppe Math-codegen We alert you by email or Slack (account required).
- Priority
- 74
- CVSS 3.1
- 9.8
- EPSS
- —
- Auth required
- No
- Published
- May 8, 2026
- Updated
- Oct 26, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-94
- SSVC (CISA)
- Exploitation: none · Automatable: yes · Technical impact: total
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
What happens
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.
What to do
- Apply the vendor's security update for Math-codegen.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | math-codegen |
< 0.4.3 |
0.4.3 |
npm install math-codegen@0.4.3 |
Per OSV / GitHub Advisories (GHSA-p6x5-p4xf-cc4r). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| mauriciopoppe | math-codegen | < 0.4.3 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch
- github.com Issue Tracking
- github.com Vendor Advisory