MEDIUM 5.3

CVE-2026-54270: protobufjs Memory Exhaustion via Unknown Fields

protobufjs, a popular JavaScript library for working with Protocol Buffers, has a memory exhaustion vulnerability in versions 8.2.0 through 8.4.2. When decoding untrusted protobuf messages, the library automatically stores unknown fields in memory without providing a way to discard them at decode time. An attacker can craft a malicious protobuf payload with many unknown fields that forces the decoded message to consume far more memory than the payload's raw size would suggest, potentially causing denial of service through resource exhaustion. The vulnerability affects applications that decode protobuf data from untrusted sources, particularly those handling user-supplied or network-sourced messages. Version 8.5.0 introduced options to control unknown-field retention, and version 8.6.2 made discarding unknown fields the default behavior.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.3 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Weaknesses (CWE)
CWE-770
Affected products
1 configuration(s)
Published / Modified
2026-06-22 / 2026-06-24

NVD description (verbatim)

protobufjs compiles protobuf definitions into JavaScript (JS) functions. From 8.2.0 to 8.4.2, protobufjs preserved unknown wire elements in message.$unknowns and did not provide a decode-time option to discard unknown fields before retaining them. A crafted protobuf payload containing many unknown fields could therefore cause a decoded message to retain substantially more memory than the input size would suggest, even when unknown-field round-tripping is not needed. protobufjs 8.5.0 added the relevant decode-time options, allowing applications that decode untrusted protobuf data to disable unknown-field retention during decode. protobufjs 8.6.2 flips the default so unknown fields are discarded unless explicitly opted into.

1 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

protobufjs processes Protocol Buffer wire format messages and converts unknown fields (fields not defined in the .proto schema) into JavaScript objects stored in the message.$unknowns property. Between versions 8.2.0 and 8.4.2, there was no decode-time mechanism to prevent this preservation. An adversary can construct a protobuf message with a large number of unknown fields that, when decoded, creates a message object whose in-memory representation significantly exceeds the input payload size. This occurs because each unknown field is parsed and retained as a JavaScript object, allowing memory consumption to scale with the number of crafted fields rather than the original message size. The CWE-770 classification (Allocation of Resources Without Limits or Throttling) reflects the unbounded memory retention triggered by untrusted input. The CVSS 3.1 score of 5.3 (Medium) indicates a network-exploitable availability impact without authentication required.

Business impact

Applications using protobufjs to decode untrusted protobuf data face availability risk. A single crafted message can cause memory exhaustion on the receiving service, leading to performance degradation or process crashes. This is particularly concerning for API gateways, microservices, and cloud-native applications that handle protobuf traffic at scale. Web applications, backend services, and real-time communication platforms using protobufjs are vulnerable if they process messages from untrusted clients. The impact is limited to availability (no data breach or integrity compromise), but repeated or distributed attacks could sustain resource exhaustion across infrastructure. Organizations relying on protobufjs for production message handling should prioritize patching to restore control over memory behavior.

Affected systems

The vulnerability affects protobufjs versions 8.2.0 through 8.4.2 inclusive. Any application or service using protobufjs within this version range to decode untrusted protobuf messages is at risk. This includes Node.js servers, Electron applications, browser-based JavaScript clients that receive protobuf data, and bundled JavaScript libraries that embed protobufjs. Systems that only encode protobuf data or that only decode messages from trusted sources (e.g., internal services under your control) face lower risk. Custom protobuf toolchains built on top of protobufjs are also affected if they decode untrusted input.

Exploitability

This vulnerability requires no user interaction, authentication, or special network conditions to exploit. An attacker simply sends a crafted protobuf message to a vulnerable service. The attack is straightforward to execute: construct a message with many unknown fields and send it via any channel the target application accepts protobuf data (REST API, gRPC, message queue, etc.). No advanced tooling is required beyond basic protobuf encoding knowledge. However, the impact is denial of service through resource exhaustion; it does not enable code execution, data theft, or system takeover. The vulnerability is not currently listed on the CISA Known Exploited Vulnerabilities (KEV) catalog, suggesting limited public weaponization at this time, though that status may change.

Remediation

Upgrade to protobufjs version 8.5.0 or later. Version 8.5.0 introduced decode-time options to control unknown-field retention, allowing applications to explicitly opt-in to preserving unknown fields only when needed. Version 8.6.2 and later make discarding unknown fields the default, providing better protection by default. Applications that require round-tripping of unknown fields can still enable retention at decode time via configuration. Review your application's protobuf decode paths to confirm whether unknown-field preservation is actually needed for your use case; in most scenarios, discarding unknown fields is safe and desirable.

Patch guidance

Update protobufjs to version 8.5.0 or later; version 8.6.2 or later is recommended for default-safe behavior. Check your package.json or dependency manifest and run npm update protobufjs (or equivalent for your build system). If you are on version 8.2.0–8.4.2, upgrading is straightforward with no breaking API changes for standard decode operations. If your application specifically relies on accessing unknown fields via $unknowns, verify that behavior remains available in the patched version and configure it explicitly if needed. Test the upgrade in a staging environment before production rollout, particularly if your application handles high-volume protobuf traffic.

Detection guidance

Monitor for unusual memory consumption spikes on services that decode protobuf messages. Alerting on process memory growth or OOM kills correlated with protobuf decode activity can indicate exploitation attempts. In application logs, look for errors related to memory allocation failures or garbage collection pressure. Network intrusion detection systems may flag abnormally large protobuf payloads with unexpected field counts; baseline your typical message sizes and alert on outliers. If you have visibility into decoded messages, monitor the size of $unknowns objects on messages from untrusted sources. Implement rate limiting on protobuf decode operations and per-source message size limits as defense-in-depth.

Why prioritize this

This vulnerability warrants medium priority in patch cycles. It affects a widely-used JavaScript protobuf library with a straightforward, low-cost fix (version upgrade). The attack surface is broad—any application decoding protobuf from the network or user input is exposed. The impact is availability-focused rather than confidentiality or integrity, so it is not an emergency. However, the ease of exploitation and the potential for distributed denial-of-service attacks mean this should be scheduled within a normal maintenance window (weeks, not months). Organizations handling high-traffic protobuf services should prioritize sooner.

Risk score, explained

The CVSS 3.1 score of 5.3 (Medium) reflects a network-exploitable vulnerability with low attack complexity and no authentication, but limited impact scope (availability only). The scoring appropriately captures that an unauthenticated attacker can trigger resource exhaustion from the network without special privileges. It does not reach High or Critical severity because there is no confidentiality or integrity compromise. In practice, your internal risk assessment should consider your use of protobufjs, the trustworthiness of your message sources, and your infrastructure's resilience to availability attacks—factors that may elevate or lower urgency relative to the baseline CVSS.

Frequently asked questions

Does this vulnerability allow remote code execution or data theft?

No. The vulnerability is limited to denial of service through memory exhaustion. An attacker cannot execute code, steal data, or modify messages. The impact is availability only.

If our application never accesses the $unknowns field, are we still vulnerable?

Yes. The memory exhaustion occurs during the decode operation itself, regardless of whether your application later reads $unknowns. The malicious fields consume memory as soon as the message is decoded. Upgrading to version 8.5.0+ and disabling unknown-field retention at decode time will eliminate this risk.

Can we mitigate this without upgrading if we validate message size?

Partial mitigation is possible: enforcing strict per-message size limits and rate limiting protobuf decodes can reduce the window for exploitation. However, these are defenses-in-depth, not substitutes for patching. A crafted message with many small unknown fields can still cause memory inflation despite size checks. Upgrading is the authoritative fix.

How do we know if we're using an affected version of protobufjs?

Check your package-lock.json or package.json for the protobufjs version. Run npm list protobufjs to see the installed version. If it is 8.2.0 through 8.4.2, you are affected. Versions 8.5.0 and later include the fix.

This analysis is based on CVE-2026-54270 as published and known technical details as of the advisory date. Verify all patch version numbers and affected versions against the official protobufjs releases and vendor advisories before making deployment decisions. The severity and exploitability assessment applies to typical network environments; your specific risk depends on how your organization uses protobufjs, the trustworthiness of your message sources, and your infrastructure's resource constraints. This document does not constitute security advice for your specific system; consult your internal security team and vendor documentation for deployment decisions. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).