# CVE-2026-54271: protobufjs-cli code injection in pbjs static code generation

Source: https://junglewise.ai/threats/cve-2026-54271-protobufjs-cli-code-injection-in-pbjs-static-code-generation  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-22. Updated: 2026-06-22  
License: CC BY 4.0 with a link back

CVE-2026-54271 · Severity: high · CVSS 8.2 · Published 2026-06-22

protobufjs-cli is a tool used to generate JavaScript code from Protocol Buffer schemas. A security flaw allows an attacker to inject malicious code into the generated files if they can influence the JSON descriptors used during the build process. If these generated files are later run or imported into an application, the attacker's code could execute, potentially leading to a full system compromise or data theft.

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

## Quick answers

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

**How severe is CVE-2026-54271?** High severity, with a CVSS score of 8.2, published 22 June 2026.

**Which products and versions are affected?** protobufjs-cli (npm) SEMVER:introduced=0,fixed=1.3.2.

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

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

**Am I affected by CVE-2026-54271?** Check whether you run protobufjs-cli (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-cli (npm): upgrade to 1.3.2 or later

  ```sh
  npm install protobufjs-cli@1.3.2
  ```


## Technical details

This vulnerability is a code injection (CWE-94) resulting from an incomplete fix for CVE-2026-44295. The 'pbjs' command-line tool fails to properly neutralize unsafe names when generating static or static-module output from JSON descriptor inputs. An attacker who can influence these descriptors can inject arbitrary JavaScript references into the output. Exploitation requires the attacker to provide a crafted JSON descriptor to the build process, and for the resulting generated code to be executed or imported by the target application. The vulnerability is fixed in versions 1.3.2 and 2.5.0.

## Affected products

- protobufjs protobufjs-cli < 1.3.2, >= 2.0.0 < 2.5.0

## Identifiers

- CVE-2026-54271
- GHSA-pr59-h9ph-3fr8

## Timeline

- 2026-06-12: advisory: GitHub advisory published by dcodeIO
- 2026-06-22: disclosed: NVD publication date

## References

- [https://github.com/protobufjs/protobuf.js/security/advisories/GHSA-pr59-h9ph-3fr8](https://github.com/protobufjs/protobuf.js/security/advisories/GHSA-pr59-h9ph-3fr8)

## Related threats

- [protobufjs property shadowing and uncontrolled recursion](https://junglewise.ai/threats/cve-2026-54269-protobufjs-property-shadowing-and-uncontrolled-recursion)
- [protobufjs-cli code injection in pbjs static code generation](https://junglewise.ai/threats/cve-2026-44295-protobufjs-cli-code-injection-in-pbjs-static-code-generation)
- [protobufjs-cli OS command injection in pbts utility](https://junglewise.ai/threats/cve-2026-42290-protobufjs-cli-os-command-injection-in-pbts-utility)
