CVE-2026-41507

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

Published May 8, 2026 CVSS 3.1 · 9.8 Critical EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-p6x5-p4xf-cc4r Remote Code Execution (RCE) via String Literal Injection into math-codegen
History
Type Values Removed Values Added
CPEs cpe:2.3:a:mauriciopoppe:math-codegen:*:*:*:*:*:*:*:*
Type Values Removed Values Added
First Time appeared Mauriciopoppe
Mauriciopoppe math-codegen
Vendors & Products Mauriciopoppe
Mauriciopoppe math-codegen
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title Remote Code Execution (RCE) via String Literal Injection into math-codegen
Weaknesses CWE-94
References
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
May 8, 2026, 2:20 PM
Reserved
Apr 20, 2026, 6:18 PM
Status
Analyzed
Published
May 8, 2026, 2:16 PM
Modified
Oct 26, 2026, 7:10 PM