Critical severity9.8NVD Advisory· Published Apr 18, 2026· Updated Apr 23, 2026
CVE-2026-41242
CVE-2026-41242
Description
protobufjs compiles protobuf definitions into JavaScript (JS) functions. In versions prior to 8.0.1 and 7.5.5, attackers can inject arbitrary code in the "type" fields of protobuf definitions, which will then execute during object decoding using that definition. Versions 8.0.1 and 7.5.5 patch the issue.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
protobufjsnpm | >= 8.0.0, < 8.0.1 | 8.0.1 |
protobufjsnpm | < 7.5.5 | 7.5.5 |
Affected products
2cpe:2.3:a:protobufjs_project:protobufjs:*:*:*:*:*:node.js:*:*+ 1 more
- cpe:2.3:a:protobufjs_project:protobufjs:*:*:*:*:*:node.js:*:*range: <7.5.5
- cpe:2.3:a:protobufjs_project:protobufjs:8.0.0:*:*:*:*:node.js:*:*
Patches
2ff7b2afef875fix: filter invalid characters from the type name (#2127)
1 file changed · +1 −0
src/type.js+1 −0 modified@@ -29,6 +29,7 @@ var Enum = require("./enum"), * @param {Object.<string,*>} [options] Declared options */ function Type(name, options) { + name = name.replace(/\W/g, ""); Namespace.call(this, name, options); /**
535df444ac06fix: filter invalid characters from the type name (#2127)
1 file changed · +1 −0
src/type.js+1 −0 modified@@ -29,6 +29,7 @@ var Enum = require("./enum"), * @param {Object.<string,*>} [options] Declared options */ function Type(name, options) { + name = name.replace(/\W/g, ""); Namespace.call(this, name, options); /**
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
7- github.com/protobufjs/protobuf.js/commit/535df444ac060243722ac5d672db205e5c531d75nvdPatchWEB
- github.com/protobufjs/protobuf.js/commit/ff7b2afef8754837cc6dc64c864cd111ab477956nvdPatchWEB
- github.com/protobufjs/protobuf.js/security/advisories/GHSA-xq3m-2v4x-88ggnvdExploitVendor AdvisoryWEB
- github.com/advisories/GHSA-xq3m-2v4x-88ggghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-41242ghsaADVISORY
- github.com/protobufjs/protobuf.js/releases/tag/protobufjs-v7.5.5nvdProductRelease NotesWEB
- github.com/protobufjs/protobuf.js/releases/tag/protobufjs-v8.0.1nvdProductRelease NotesWEB
News mentions
0No linked articles in our index yet.