CVE-2026-41242: Protobufjs Arbitrary Code Execution Vulnerability
CRITICALCVE-2026-41242 is a CRITICAL (CVSS 9.8) arbitrary code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Protobufjs libraries in the npm ecosystem. The issue involves arbitrary code execution in protobufjs. Remediation is available by upgrading affected packages to version 8.0.1, 7.5.5.
CVE-2026-41242 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-41242
To remediate this vulnerability, upgrade all affected Protobufjs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install protobufjs@8.0.1
npm install protobufjs@7.5.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls protobufjs
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-41242, inspect your project dependencies using npm:
npm ls protobufjs
Analyze the terminal output to locate any version of Protobufjs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.0.1), your application is affected.
Note: The npm ls protobufjs command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Protobufjs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-41242 Affected Protobufjs Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
protobufjs
|
npm |
≥ 8.0.0
< 8.0.1
|
8.0.1
|
|
protobufjs
|
npm |
< 7.5.5
|
7.5.5
|
References
Frequently Asked Questions
What is CVE-2026-41242?
Which Protobufjs versions are affected?
What version fixes CVE-2026-41242?
Is protobufjs affected?
What is the CVSS score of CVE-2026-41242?
What CWE is associated with CVE-2026-41242?
How can I check npm dependencies for CVE-2026-41242?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xq3m-2v4x-88gg",
"modified" : "2026-05-04T22:12:42Z",
"published" : "2026-04-16T22:34:57Z",
"aliases" : [ "CVE-2026-41242" ],
"summary" : "Arbitrary code execution in protobufjs",
"details" : "## Summary\n\nprotobufjs could execute generated JavaScript code derived from protobuf schema metadata. When loading a crafted JSON descriptor, schema-controlled type names and type references could reach runtime code generation without sufficient validation.\n\n## Impact\n\nAn attacker who can provide a malicious protobuf definition or JSON descriptor to an application may be able to execute arbitrary JavaScript in the context of the process using protobufjs.\n\nThis requires control over the protobuf schema or descriptor being loaded. Applications that only decode messages using trusted, application-defined schemas are not directly affected by this issue.\n\n## Preconditions\n\n- The application must allow an attacker to control or influence a protobuf definition or JSON descriptor.\n- The application must load that definition through protobufjs reflection APIs such as descriptor loading.\n- The affected generated-code path must be reached, for example by performing an operation on the loaded type.\n\n## Workarounds\n\nDo not load protobuf definitions or JSON descriptors from untrusted sources with affected versions. If untrusted schemas must be accepted, validate or restrict them before loading and run schema processing in an isolated environment.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "protobufjs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.0.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "protobufjs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.5.5"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/protobufjs/protobuf.js/security/advisories/GHSA-xq3m-2v4x-88gg"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41242"
}, {
"type" : "WEB",
"url" : "https://github.com/protobufjs/protobuf.js/commit/535df444ac060243722ac5d672db205e5c531d75"
}, {
"type" : "WEB",
"url" : "https://github.com/protobufjs/protobuf.js/commit/ff7b2afef8754837cc6dc64c864cd111ab477956"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/protobufjs/protobuf.js"
}, {
"type" : "WEB",
"url" : "https://github.com/protobufjs/protobuf.js/releases/tag/protobufjs-v7.5.5"
}, {
"type" : "WEB",
"url" : "https://github.com/protobufjs/protobuf.js/releases/tag/protobufjs-v8.0.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-16T22:34:57Z",
"nvd_published_at" : "2026-04-18T17:16:13Z"
}
}