Skip to content
Fencer Vulns
critical 9.8

CVE-2026-41507 json

Remote Code Execution (RCE) via String Literal Injection into math-codegen

published 2026-04-17 6 mo ago modified 2026-10-26 13 d ago also GHSA-p6x5-p4xf-cc4r , EUVD-2026-28597

cvss
9.8
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.4%
EPSS 0.4% chance of exploitation in 30 days, percentile 33%
public exploits
0
none known

Summary

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.

Patch / fix

  • npm math-codegen 0.4.3
  • mauriciopoppe math-codegen 0.4.3

CISA SSVC

Exploitation
none
Automatable
yes
Technical impact
total
Assessed
6 mo ago

Exploit prediction

0.39% chance of exploitation in the next 30 days, higher than 33% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
npm math-codegen
<0.4.3
0.4.3

Affected products

  • mauriciopoppe math-codegen

Classification

Weakness
  • CWE-94 Improper Control of Generation of Code

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.