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.
- 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
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
Which versions are affected by CVE-2026-42290?
4 open source packages ship an affected version, including protobufjs-cli. It affects 1 product.
| Package | 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 include 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.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
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
Sources
Also known as GHSA-f84p-cvgm-xgjj.