Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-41507: CWE-94: Improper Control of Generation of Code ('Code Injection') in mauriciopoppe math-codegen

0
Critical
VulnerabilityCVE-2026-41507cvecve-2026-41507cwe-94
Published: Fri May 08 2026 (05/08/2026, 13:49:34 UTC)
Source: CVE Database V5
Vendor/Project: mauriciopoppe
Product: math-codegen

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.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 05/08/2026, 14:22:28 UTC

Technical Analysis

The mauriciopoppe math-codegen library generates code from mathematical expressions. Before version 0.4.3, it improperly handled string literals passed to the cg.parse() function by injecting them verbatim into a new Function() body without sanitization. This improper control of code generation (CWE-94) enables attackers to execute arbitrary system commands when user input is passed to the parser, leading to full remote code execution. The vulnerability has a CVSS 3.1 base score of 9.8, indicating critical severity. The issue is fixed in version 0.4.3.

Potential Impact

Exploitation of this vulnerability allows an unauthenticated attacker to achieve full remote code execution on any application that exposes a math evaluation endpoint where user input is passed to cg.parse(). This can lead to complete system compromise, data loss, or further attacks. There are no known exploits in the wild at this time.

Mitigation Recommendations

Upgrade to mauriciopoppe math-codegen version 0.4.3 or later, where this vulnerability has been patched. Applications using affected versions should immediately update to the fixed version to prevent exploitation. Patch status is not explicitly stated in a vendor advisory, but the description confirms the issue is fixed in version 0.4.3.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-04-20T18:18:50.681Z
Cvss Version
3.1
State
PUBLISHED
Remediation Level
null

Threat ID: 69fdede4cbff5d8610dd27ad

Added to database: 5/8/2026, 2:06:28 PM

Last enriched: 5/8/2026, 2:22:28 PM

Last updated: 5/9/2026, 3:47:17 AM

Views: 5

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses