CVE-2026-41507 Details
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.
A remote code execution vulnerability exists in math-codegen versions prior to 0.4.3. The issue arises because string literals sent to the function 'cg.parse()' are injected directly into a 'new Function()' body without any sanitization. This flaw enables attackers to execute arbitrary system commands if user-controlled input is allowed to reach the parser. Applications with a math evaluation endpoint that processes user input through 'cg.parse()' are susceptible to this vulnerability.
Users are advised to upgrade to math-codegen version 0.4.3 or later. The vulnerability has been fixed by modifying the code generation process to include proper sanitization of string literals, ensuring they are treated as data rather than executable code.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed May 8, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-94 | Improper Control of Generation of Code ('Code Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| mauriciopoppe math-codegen | < 0.4.3 |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| May 12, 2026 | Initial Analysis | [email protected] |
| May 8, 2026 | New CVE Received | [email protected] |