---
title: "CVE-2026-41507: Remote Code Execution (RCE) via String Literal Injection into math-codegen"
url: https://erroneo.us/security/cve/CVE-2026-41507/
description: "CVE-2026-41507 (math-codegen (npm)): math-codegen generates code from mathematical expressions. Prior to version 0.4.3, string literal content passed to…"
type: vulnerability-record
section: "Security Digest"
date_published: 2026-05-08
date_modified: 2026-05-12
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2026-41507"
kev: false
cvss: 9.8
epss: 0.00672
license: All rights reserved. Quote with attribution and a link.
---

# CVE-2026-41507: Remote Code Execution (RCE) via String Literal Injection into math-codegen

**Signal:** Critical and remotely reachable. No known exploitation yet, but it is network-reachable without credentials. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

- No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
- EPSS 0.7% , percentile 51: FIRST’s model estimates a 0.7% chance of exploitation activity in the next 30 days, higher than 51% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
- Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
- Only applies if your dependency tree includes math-codegen (npm) < 0.4.3, fixed in 0.4.3 . Check your lockfile, including transitive dependencies.

## What it is

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.

## Affected packages

- npm `math-codegen` < 0.4.3 → fixed: 0.4.3

## Affected products (CVE record)

- mauriciopoppe math-codegen: < 0.4.3

## Severity

- GitHub_M CVSS 3.1: 9.8 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- GitHub CVSS 3.1: 9.8 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## Exploitation

- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation none , automatable yes , technical impact total .
- FIRST EPSS (model of 2026-10-21): 0.67% probability of exploitation activity in the next 30 days; percentile 51.

## Sources

- [GitHub Advisory GHSA-p6x5-p4xf-cc4r](https://github.com/advisories/GHSA-p6x5-p4xf-cc4r)
- [CVE.org record CVE-2026-41507](https://www.cve.org/CVERecord?id=CVE-2026-41507)
- [NVD entry CVE-2026-41507](https://nvd.nist.gov/vuln/detail/CVE-2026-41507)
- [github.com](https://github.com/mauriciopoppe/math-codegen/security/advisories/GHSA-p6x5-p4xf-cc4r)
- [github.com](https://github.com/mauriciopoppe/math-codegen/pull/11)
- [github.com](https://github.com/mauriciopoppe/math-codegen/commit/4bb52d3030683362b3559ee8dd91350555a05f6b)
- [github.com](https://github.com/hits3134)

---
Source page: https://erroneo.us/security/cve/CVE-2026-41507/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
