Skip to content

GHSA-jfj6-75fj-8934 CVE-2026-59876

protobufjs: Text Format string map parsing can mutate returned map object prototype

Medium npm
Severity
4.8 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.35%
Chance of exploitation in the next 30 days. Higher than 28.59% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-1321 Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Fix
8.6.5
Upgrade protobufjs to this version or later

Description

Summary

The protobuf.js text format extension parsed string-keyed map entries using ordinary property assignment. A text-format map entry with key __proto__ could therefore change the prototype of the returned map object instead of creating an own map entry.

This affected the optional Text Format extension. Other protobufjs input paths, including binary decode, fromObject, and ProtoJSON conversion, are not affected.

Impact

An attacker who can provide protobuf text-format input parsed by an application using protobufjs/ext/textformat may be able to create message objects whose string-keyed map fields have attacker-controlled prototypes.

This is per-object prototype mutation, not global Object.prototype pollution. Impact depends on downstream application logic treating inherited properties as meaningful, for example by using in, truthiness checks, or direct property access on parsed map objects instead of own-property checks.

Applications that do not parse untrusted Text Format input, or that do not use inherited properties from parsed map objects in security-relevant logic, are not directly affected.

Preconditions

  • The application must parse attacker-controlled protobuf Text Format input with protobufjs/ext/textformat.
  • The target schema must contain a string-keyed map field.
  • The crafted input must provide a map entry with key __proto__.
  • Downstream application logic must treat inherited properties on the returned map object as meaningful for impact beyond malformed output.

Workarounds

Upgrade to protobufjs 8.6.5 or newer.

If immediate upgrade is not possible, do not parse untrusted protobuf Text Format input with affected versions. Applications can also reject string map keys named __proto__ before or during Text Format parsing, and should use own-property checks such as Object.hasOwnProperty.call(map, key) when consuming parsed map objects.

Affected versions

npm

PackageVulnerableFixed in
protobufjs
>= 8.2.0, < 8.6.5
8.6.5

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

protobufjs npm → 8.6.5

npm
npm install protobufjs@8.6.5
yarn
yarn add protobufjs@8.6.5
pnpm
pnpm add protobufjs@8.6.5

Severity breakdown

CVSS 3.1 4.8

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

Weakness

CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')

The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.

How to prevent it
  • Implementation: By freezing the object prototype first (for example, Object.freeze(Object.prototype)), modification of the prototype becomes impossible.
  • Architecture and Design: By blocking modifications of attributes that resolve to object prototype, such as proto or prototype, this weakness can be mitigated.
  • Implementation: When handling untrusted objects, validating using a schema can be used.
  • Implementation: By using an object without prototypes (via Object.create(null) ), adding object prototype attributes by accessing the prototype via the special attributes becomes impossible, mitigating this weakness.
  • Implementation: Map can be used instead of objects in most cases. If Map methods are used instead of object attributes, it is not possible to access the object prototype or modify it.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-j3f2-48v5-ccww
protobufjs: Denial of Service via infinite loop in .proto option parsing
High Also affects protobufjs
GHSA-94rc-8x27-4472
protobufjs: Memory amplification from preserved unknown fields in binary decode
Medium Also affects protobufjs
GHSA-wcpc-wj8m-hjx6
protobufjs: Denial of service through unbounded Any expansion during JSON conversion
High Also affects protobufjs
GHSA-f38q-mgvj-vph7
protobufjs : Schema-derived names can shadow runtime-significant properties
Medium Also affects protobufjs
GHSA-jggg-4jg4-v7c6
protobufjs: Denial of Service via unbounded recursive JSON descriptor expansion
High Also affects protobufjs
GHSA-2pr8-phx7-x9h3
protobuf.js: Denial of service from crafted field names in generated code
Medium Also affects protobufjs
GHSA-66ff-xgx4-vchm
protobuf.js: Code injection through bytes field defaults in generated toObject code
High Also affects protobufjs
GHSA-fx83-v9x8-x52w
protobuf.js: Prototype injection in generated message constructors
Medium Also affects protobufjs
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor