CVE-2026-44291: protobufjs: Code generation gadget after prototype pollution
Summary
protobufjs used plain objects with inherited prototypes for internal type lookup tables used by generated encode and decode functions. If Object.prototype had already been polluted, those lookup tables could resolve attacker-controlled inherited properties as valid protobuf type information.
This could cause attacker-controlled strings to be emitted into generated JavaScript code.
Impact
An attacker who can first trigger a prototype pollution vulnerability may be able to influence generated protobufjs encode or decode functions in a way that can lead to arbitrary JavaScript execution.
This issue requires a separate prototype pollution primitive before protobufjs is invoked.
Applications without a reachable prototype pollution primitive are not directly exploitable through this issue alone.
Preconditions
- The application or one of its dependencies must allow an attacker to pollute Object.prototype. - The polluted property must affect protobufjs internal type lookup behavior. - The application must use protobufjs functionality that generates encode or decode code for affected types. - The generated code path must be reached after the prototype pollution has occurred.
Workarounds
Avoid running affected versions in applications where attacker-controlled input can pollute Object.prototype. If immediate upgrade is not possible, remove or mitigate reachable prototype pollution primitives and isolate schema/message processing from untrusted application state.
Other sources
protobufjs compiles protobuf definitions into JavaScript (JS) functions. Prior to 7.5.6 and 8.0.2, protobufjs used plain objects with inherited prototypes for internal type lookup tables used by generated encode and decode functions. If Object.prototype had already been polluted, those lookup tables could resolve attacker-controlled inherited properties as valid protobuf type information. This could cause attacker-controlled strings to be emitted into generated JavaScript code. This vulnerability is fixed in 7.5.6 and 8.0.2.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/protobufjsto a version that resolves this vulnerability.Fixed in 8.0.2 - Upgrade
Upgrade
npm/protobufjsto a version that resolves this vulnerability.Fixed in 7.5.6 - Upgrade
Upgrade
protobufjsto a version that resolves this vulnerability.Fixed in 7.5.6 - Upgrade
Upgrade
protobufjsto a version that resolves this vulnerability.Fixed in 8.0.2 - Compensating control
Avoid running affected versions of protobufjs in applications where attacker-controlled input can pollute Object.prototype.
- Compensating control
If immediate upgrade is not possible, remove or mitigate any reachable prototype pollution primitives, and isolate schema/message processing from untrusted application state.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-44291?
The severity of CVE-2026-44291 is classified as high due to the potential for exploitation through prototype pollution.
How do I fix CVE-2026-44291?
To fix CVE-2026-44291, you should upgrade protobufjs to version 8.0.2 or 7.5.6.
What versions of protobufjs are affected by CVE-2026-44291?
CVE-2026-44291 affects protobufjs versions from 8.0.0 to 8.0.1 and 7.5.5 and below.
What risks does CVE-2026-44291 pose to applications using protobufjs?
Applications using protobufjs are at risk of accepting attacker-controlled properties, leading to potential data corruption or arbitrary code execution.
Where can I find more information about CVE-2026-44291?
More information about CVE-2026-44291 can be found in the security advisories provided by the protobufjs project.