# CVE-2026-42290: protobufjs-cli: OS Command Injection

> Attackers can execute arbitrary OS commands via shell metacharacters in file paths when using the protobufjs-cli tool to generate TypeScript definitions.

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 13 May 2026
- **Updated:** 18 May 2026
- **Also known as:** GHSA-f84p-cvgm-xgjj

## What is CVE-2026-42290?

CVE-2026-42290 is a high-severity command injection vulnerability in protobufjs protobuf.js, published on 13 May 2026. It can only be exploited from the same machine or local network, 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.2.1 and 2.0.2, pbts invoked JSDoc by building a shell command string from input file paths and executing it through child_process.exec. File paths containing shell metacharacters could therefore be interpreted by the shell instead of being passed to JSDoc as plain arguments. This vulnerability is fixed in 1.2.1 and 2.0.2.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command)

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

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.2.1 |
| `protobufjs-cli` | npm | All versions | 1.2.1 |
| `protobufjs-cli` | npm | From 2.0.0 | 2.0.2 |
| `protobufjs-cli` | npm | From 2.0.0 | 2.0.2 |

Products: Protobufjs Project Protobufjs-Cli.

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

Upgrade protobufjs-cli to a fixed version for your release line: 1.2.1 or 2.0.2.

## Is CVE-2026-42290 being exploited?

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

## Other vulnerabilities in protobufjs protobuf.js

- [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-54271](https://insights.sbomify.com/CVE-2026-54271/): protobufjs-cli: Code injection in pbjs static output from crafted JSON descriptor names (high 8.2)

## Fix prompt for AI coding agents

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

What it is: CVE-2026-42290 is a high-severity command injection vulnerability in protobufjs protobuf.js, published on 13 May 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-42290 in the wild and no public exploit code.

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

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-42290/ (Markdown: https://insights.sbomify.com/CVE-2026-42290/index.md)
```

## Sources

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

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