CVE-2026-41507

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.
Configurations

Configuration 1 (hide)

cpe:2.3:a:mauriciopoppe:math-codegen:*:*:*:*:*:*:*:*

History

12 May 2026, 14:26

Type Values Removed Values Added
First Time Mauriciopoppe
Mauriciopoppe math-codegen
References () https://github.com/mauriciopoppe/math-codegen/commit/4bb52d3030683362b3559ee8dd91350555a05f6b - () https://github.com/mauriciopoppe/math-codegen/commit/4bb52d3030683362b3559ee8dd91350555a05f6b - Patch
References () https://github.com/mauriciopoppe/math-codegen/pull/11 - () https://github.com/mauriciopoppe/math-codegen/pull/11 - Issue Tracking
References () https://github.com/mauriciopoppe/math-codegen/security/advisories/GHSA-p6x5-p4xf-cc4r - () https://github.com/mauriciopoppe/math-codegen/security/advisories/GHSA-p6x5-p4xf-cc4r - Vendor Advisory
CPE cpe:2.3:a:mauriciopoppe:math-codegen:*:*:*:*:*:*:*:*

08 May 2026, 14:16

Type Values Removed Values Added
New CVE

Information

Published : 2026-05-08 14:16

Updated : 2026-05-12 14:26


NVD link : CVE-2026-41507

Mitre link : CVE-2026-41507

CVE.ORG link : CVE-2026-41507


JSON object : View

Products Affected

mauriciopoppe

  • math-codegen
CWE
CWE-94

Improper Control of Generation of Code ('Code Injection')