# CVE-2026-54271: protobufjs-cli: Code injection in pbjs static output from crafted JSON descriptor names

> Attackers can inject malicious code into generated JavaScript files via crafted JSON descriptors, leading to execution when the output is used.

- **Severity:** High 8.2 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 22 Jun 2026
- **Updated:** 23 Jun 2026
- **Also known as:** CLEANSTART-2026-QX07300, GHSA-pr59-h9ph-3fr8

## What is CVE-2026-54271?

CVE-2026-54271 is a high-severity code injection vulnerability in protobufjs-cli, published on 22 Jun 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

protobufjs-cli is the command line add-on for protobuf.js. Prior to 1.3.2 and 2.5.0, a previous fix for unsafe name handling in pbjs static / static-module code generation was incomplete. Affected versions of protobufjs-cli could still emit unsafe JavaScript references when generating static output from crafted JSON descriptor input. The common case of parsing schemas from .proto files is not affected. This is a bypass of CVE-2026-44295. An attacker who can provide or influence pre-parsed JSON descriptors passed to pbjs static code generation may be able to cause generated JavaScript output to contain attacker-controlled code. The injected code may execute if the generated file is later executed or imported and an affected generated API path is invoked. This vulnerability is fixed in 1.3.2 and 2.5.0.

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2026-54271?

4 open source packages ship an affected version, including protobufjs-cli. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `protobufjs-cli` | npm | All versions | 1.3.2 |
| `protobufjs-cli` | npm | All versions | 1.3.2 |
| `protobufjs-cli` | npm | From 2.0.0 | 2.5.0 |
| `protobufjs-cli` | npm | From 2.0.0 | 2.5.0 |

Products: Protobufjs Project Protobufjs-Cli.

## How do I fix CVE-2026-54271?

Upgrade protobufjs-cli to a fixed version for your release line: 1.3.2 or 2.5.0.

## Is CVE-2026-54271 being exploited?

There is no known exploitation of CVE-2026-54271 in the wild and no public exploit code.

## Other vulnerabilities in protobufjs-cli

- [CVE-2026-44295](https://insights.sbomify.com/CVE-2026-44295/): protobufjs-cli: Code injection in pbjs static output from crafted schema names (high 8.7)
- [CVE-2026-42290](https://insights.sbomify.com/CVE-2026-42290/): protobufjs-cli: OS Command Injection (high 7.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-54271 and fix it if it is affected.

What it is: CVE-2026-54271 is a high-severity code injection vulnerability in protobufjs-cli, published on 22 Jun 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-54271 in the wild and no public exploit code.

Affected packages and fixed versions:
- protobufjs-cli (npm): affected all versions; fixed in 1.3.2
- protobufjs-cli (npm): affected all versions; fixed in 1.3.2
- protobufjs-cli (npm): affected from 2.0.0; fixed in 2.5.0
- protobufjs-cli (npm): affected from 2.0.0; fixed in 2.5.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-54271/ (Markdown: https://insights.sbomify.com/CVE-2026-54271/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-54271
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-54271
- OSV: https://osv.dev/vulnerability/CVE-2026-54271

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-54271/
Summaries are generated and may contain mistakes; the official description above is the record.
