Skip to content

GHSA-wcpc-wj8m-hjx6 CVE-2026-48712

protobufjs: Denial of service through unbounded Any expansion during JSON conversion

High npm
Severity
7.5 / 10
High · CVSS 3.1
Exploit chance (EPSS)
0.46%
Chance of exploitation in the next 30 days. Higher than 39.89% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-674 Uncontrolled Recursion
Fix
7.6.1
Upgrade protobufjs to this version or later

Description

Summary

protobufjs could recurse without a depth limit while converting decoded messages to plain objects or JSON. This affected generated toObject() conversion and the custom google.protobuf.Any JSON conversion path.

A crafted protobuf binary payload containing deeply nested Any values could cause the JavaScript call stack to be exhausted during conversion to JSON.

Impact

An attacker who can provide protobuf binary data decoded by an application may be able to crash the process or otherwise cause message conversion to fail with a stack overflow.

This affects applications that decode untrusted protobuf input containing google.protobuf.Any values and then convert decoded messages to JSON or plain objects with JSON conversion enabled, for example through JSON.stringify(message), Message#toJSON(), or Type.toObject(message, { json: true }).

Applications that only decode and re-encode protobuf binary data without converting decoded messages to JSON are not directly affected by this issue.

Preconditions

  • The application must decode protobuf binary data influenced by an attacker.
  • The application schema must include google.protobuf.Any, and the referenced type_url must resolve to a message type in the loaded protobuf root.
  • The application must convert the decoded message to JSON or a plain object through an affected conversion path.
  • The crafted input must contain deeply nested Any values that are expanded during conversion.

Workarounds

Avoid converting untrusted protobuf messages containing google.protobuf.Any values to JSON with affected versions. If immediate upgrade is not possible, reject or limit messages with deeply nested Any payloads at an outer protocol boundary where feasible, avoid JSON conversion of untrusted Any values, or isolate message conversion in a process that can be safely restarted.

Affected versions

npm

PackageVulnerableFixed in
protobufjs
< 7.6.1
7.6.1
protobufjs
>= 8.0.0, < 8.4.1
8.4.1

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 → 7.6.1

npm
npm install protobufjs@7.6.1
yarn
yarn add protobufjs@7.6.1
pnpm
pnpm add protobufjs@7.6.1

Severity breakdown

CVSS 3.1 7.5

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

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

Weakness

CWE-674: Uncontrolled Recursion

The product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack.

How to prevent it
  • Implementation: Ensure that an end condition will be reached under all logic conditions. The end condition may include checking against the depth of recursion and exiting with an error if the recursion goes too deep. The complexity of the end condition contributes to the effectiveness of this action.
  • Implementation: Increase the stack size.

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-jfj6-75fj-8934
protobufjs: Text Format string map parsing can mutate returned map object prototype
Medium Also affects protobufjs
GHSA-94rc-8x27-4472
protobufjs: Memory amplification from preserved unknown fields in binary decode
Medium 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