CVE-2026-48712: protobufjs Stack Exhaustion via Recursive Nesting - Denial of Service
protobufjs is a widely used JavaScript library that converts protobuf message definitions into executable code. Versions before 7.6.1 and 8.4.1 contain a flaw where the library fails to limit recursion depth when converting decoded protobuf messages to plain JavaScript objects or JSON format. An attacker can craft a malicious protobuf message with deeply nested structures (particularly using the google.protobuf.Any type) that will cause the JavaScript runtime to exhaust its call stack, crashing the application. This is a denial-of-service vulnerability affecting any service that parses untrusted protobuf input and converts it to JSON or object form.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Weaknesses (CWE)
- CWE-674
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-22 / 2026-06-26
NVD description (verbatim)
protobufjs compiles protobuf definitions into JavaScript (JS) functions. Prior to 7.6.1 and 8.4.1, 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. This vulnerability is fixed in 7.6.1 and 8.4.1.
1 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability exists in protobufjs's toObject() conversion logic and the specialized JSON conversion handler for google.protobuf.Any messages. When processing a crafted protobuf binary containing recursively nested Any values, the conversion functions do not enforce a depth limit on their recursive calls. This allows an attacker-supplied payload to exceed the JavaScript engine's call stack limit (RangeError: Maximum call stack size exceeded), resulting in a process crash. The flaw affects both the major version 7 (before 7.6.1) and version 8 (before 8.4.1) branches. Applications using protobufjs to deserialize messages from external sources and then convert them to JSON representation are most at risk.
Business impact
Organizations relying on protobufjs-based services for API gateways, message processing, microservices, or real-time data platforms face availability risk. An attacker requires only the ability to send a specially crafted protobuf message to crash backend processes, potentially affecting service availability without authentication. For services deployed in auto-scaling environments, this could trigger repeated instance failures and incur operational costs. No data confidentiality or integrity impact occurs; the attack is purely a denial-of-service vector.
Affected systems
protobufjs versions 7.0.0 through 7.6.0 (inclusive) and versions 8.0.0 through 8.4.0 (inclusive) are vulnerable. Any application or service using affected versions of protobufjs to process protobuf messages is at risk, particularly those that: expose protobuf deserialization endpoints to untrusted network input, use google.protobuf.Any message types, or automatically convert deserialized messages to JSON for logging, API responses, or storage. Node.js applications, browser-based WebAssembly applications, and gRPC services are common deployment contexts.
Exploitability
Exploitation requires only network access to an application accepting protobuf input and no authentication or user interaction. The attack surface is high for services exposing gRPC endpoints, message brokers, or APIs that accept protobuf payloads. Crafting the malicious payload is straightforward—an attacker must generate a protobuf message with nested Any values exceeding the JavaScript call stack depth (typically 10,000–15,000 levels depending on the runtime). No special tools or reverse engineering is required. However, the vulnerability does not grant code execution or data access; it only degrades availability.
Remediation
Upgrade protobufjs to version 7.6.1 or later for the v7 branch, or version 8.4.1 or later for the v8 branch. These releases introduce recursion depth limits in the toObject() and Any JSON conversion code paths. Verify the fixed versions in your package.json or package-lock.json after upgrading, and test that your application's protobuf deserialization and JSON conversion workflows function correctly. For organizations unable to upgrade immediately, implement network-level protobuf message size and complexity validation as a temporary mitigation.
Patch guidance
1. Update protobufjs in your dependency tree to 7.6.1+ or 8.4.1+. 2. Use npm audit to confirm the update resolves the identified vulnerability. 3. Regenerate protobuf JavaScript bindings if using a build step (protoc compiler with protobufjs plugin). 4. Conduct integration testing of any services that deserialize protobuf and convert to JSON to ensure the recursion limits do not reject legitimate deeply nested payloads (unlikely but possible in edge cases). 5. Redeploy and monitor for any unexpected errors during the rollout.
Detection guidance
Monitor for JavaScript RangeError exceptions specifically mentioning 'Maximum call stack size exceeded' in logs from applications using protobufjs. Set up alerts on process crashes or restarts in protobufjs-dependent services. In gRPC logs, watch for sudden connection resets or service unavailability correlated with specific message receipt. Network-level intrusion detection can flag unusually nested or large protobuf payloads sent to known gRPC or protobuf-accepting endpoints. Implement input validation to reject protobuf messages exceeding a reasonable nesting depth threshold before they reach the protobufjs library.
Why prioritize this
HIGH CVSS (7.5) reflects a remotely exploitable, unauthenticated denial-of-service vulnerability with high attack complexity. Although not yet in CISA's KEV catalog, the ease of exploitation and broad use of protobufjs in modern microservice architectures make this a near-term risk. Organizations running gRPC services, message queues, or APIs that accept external protobuf input should prioritize patching within 30 days. Lower priority for applications that only deserialize protobuf from fully trusted internal sources.
Risk score, explained
CVSS 7.5 (HIGH) is justified by: Network accessibility (AV:N), no authentication required (PR:N), no special user interaction (UI:N), and high availability impact (A:H). The score reflects the ease of triggering a denial-of-service condition. No confidentiality (C:N) or integrity (I:N) impacts reduce the score from Critical. The vulnerability is not in the CISA KEV list yet, so exploit code in the wild is unknown; however, PoC development is trivial, warranting prompt patching.
Frequently asked questions
Can this vulnerability expose sensitive data or allow code execution?
No. The vulnerability causes a denial-of-service crash due to stack exhaustion. It does not permit reading, modifying, or executing arbitrary code. Attackers cannot exfiltrate data or take control of the system.
Do we need to patch both v7 and v8 if we only use one major version?
No, upgrade only the major version branch you use. If your package.json specifies ^7.x, upgrade to 7.6.1+. If it specifies ^8.x or 8.x, upgrade to 8.4.1+. Version 9 and beyond (if they exist) should be checked against the vendor advisory for their status.
What if we only deserialize protobuf from internal, trusted services?
Your risk is significantly lower. The attack requires sending a crafted protobuf message. If all protobuf input originates from internal services you control, the threat surface is minimal. However, patching is still recommended as a defense-in-depth measure in case an internal service becomes compromised.
How do we test if our application is vulnerable?
Identify any application code that calls toObject() or converts google.protobuf.Any to JSON from untrusted input. In a test environment, attempt to deserialize a protobuf message with extremely nested Any structures (e.g., Any fields containing Any fields recursively). If the process crashes with a stack overflow error before your upgrade, the version is vulnerable. After upgrading, the library should either safely limit recursion or reject the malicious input.
This analysis is provided for informational purposes and does not constitute legal or professional security advice. Organizations must verify all information against official vendor advisories and their own threat modeling. Patch version numbers and availability dates should be confirmed with the protobufjs project before deployment. SEC.co assumes no liability for operational impacts resulting from patching or remediation decisions. Test all patches in a non-production environment prior to production rollout. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-54269MEDIUMprotobufjs Name Collision Denial of Service Vulnerability
- CVE-2026-46149HIGHLinux Kernel SCSI Target Memory Disclosure & DoS Vulnerability
- CVE-2026-46373HIGHSQLFluff DoS Vulnerability – Resource Exhaustion via Nested Queries
- CVE-2026-48502HIGHMessagePack for C# Stack Overflow in Timestamp Parsing
- CVE-2026-48506HIGHMessagePack for C# Recursive Bypass Denial of Service
- CVE-2026-48512HIGHMessagePack-CSharp JSON Recursion Denial-of-Service
- CVE-2026-48513HIGHMessagePack C# Union Deserialization Denial of Service
- CVE-2026-4870HIGHIBM Qiskit SDK Parser Denial-of-Service Vulnerability