# CVE-2022-25878: protobufjs prototype pollution vulnerability

Source: https://junglewise.ai/threats/cve-2022-25878-protobufjs-prototype-pollution-vulnerability  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2022-05-28. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2022-25878 · Severity: low · CVSS 3.1 · Published 2022-05-28

Protobufjs is a JavaScript library used to serialize and deserialize Protocol Buffer messages. A prototype pollution flaw allows attackers to inject malicious properties into core JavaScript objects, potentially compromising applications that parse untrusted .proto files or pass user input to certain library functions. This could lead to data tampering, injection attacks, or application logic manipulation.

Technologies: [protobufjs (npm)](https://junglewise.ai/threats/technologies/protobufjs). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2022-25878 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2022-25878 being exploited in the wild.

**How severe is CVE-2022-25878?** Low severity, with a CVSS score of 3.1, published 28 May 2022.

**Which products and versions are affected?** protobufjs (npm) SEMVER:introduced=6.11.0,fixed=6.11.3.

**Is there a fix for CVE-2022-25878?** Yes. protobufjs (npm): upgrade to 6.11.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2022-25878 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2022-25878?** Check whether you run protobufjs (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- protobufjs (npm): upgrade to 6.11.3 or later

  ```sh
  npm install protobufjs@6.11.3
  ```


## Technical details

The vulnerability is a prototype pollution flaw (CWE-1321) in protobufjs affecting versions 6.10.0–6.10.3 and 6.11.0–6.11.3. The root cause lies in the util.setProperty and ReflectionObject.setParsedOption functions, which do not properly validate property names before modifying objects, allowing attackers to pollute Object.prototype. An attacker can exploit this by providing malicious input to these functions or by parsing a crafted .proto file. The vulnerability requires no authentication or user interaction beyond parsing untrusted protocol buffer definitions. Patches are available in versions 6.10.4+ and 6.11.4+.

## Affected products

- protobufjs protobufjs 6.10.0 through 6.10.3, 6.11.0 through 6.11.3

## Identifiers

- CVE-2022-25878
- GHSA-g954-5hwp-pp24

## Timeline

- 2022-05-28: disclosed
- 2022-05-20: patched: fix merged in PR #1731

## References

- [https://github.com/protobufjs/protobuf.js/pull/1731](https://github.com/protobufjs/protobuf.js/pull/1731)

## Related threats

- [protobufjs prototype mutation in Text Format string map parsing](https://junglewise.ai/threats/cve-2026-59876-protobufjs-prototype-pollution-in-text-format-extension)
- [protobufjs infinite loop in .proto option parsing](https://junglewise.ai/threats/cve-2026-59877-protobufjs-infinite-loop-in-proto-option-parsing)
- [protobufjs memory amplification via unknown field preservation](https://junglewise.ai/threats/cve-2026-54270-protobufjs-memory-amplification-via-unknown-field-preservation)
- [protobufjs property shadowing and uncontrolled recursion](https://junglewise.ai/threats/cve-2026-54269-protobufjs-property-shadowing-and-uncontrolled-recursion)
- [protobufjs uncontrolled recursion in JSON conversion](https://junglewise.ai/threats/cve-2026-48712-protobufjs-uncontrolled-recursion-in-json-conversion)
