CVE-2026-42290: protobuf.js is Vulnerable to OS Command Injection in the CLI
Summary pbts invoked JSDoc by building a shell command string from input file paths and executing it through childprocess.exec. File paths containing shell metacharacters could therefore be interpreted by the shell instead of being passed to JSDoc as plain arguments.
Published May 12, 2026 · Updated May 14, 2026
Affected packages
protobufjs-cli
- Ecosystem
- npm
- Affected
- <= 1.2.0
- Fixed in
- 1.2.1
- Check
npm ls protobufjs-cli
protobufjs-cli
- Ecosystem
- npm
- Affected
- >= 2.0.0, <= 2.0.1
- Fixed in
- 2.0.2
- Check
npm ls protobufjs-cli
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
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.
Impact
An attacker who can control file names or paths passed to pbts may be able to execute arbitrary shell commands with the privileges of the process running pbts.
This affects the protobufjs CLI tooling path. The protobufjs runtime APIs for encoding, decoding, parsing, and loading protobuf messages are not directly affected by this issue.
Preconditions
- The application or user must invoke
pbtson file paths influenced by an attacker. - The attacker must be able to supply or create a path containing shell-significant characters.
- The vulnerable
pbtsversion must execute the generated JSDoc command through a shell.
Workarounds
Do not run affected versions of pbts on attacker-controlled file names or paths. If this cannot be avoided, sanitize or rename input files before invoking pbts, or run the CLI in an isolated environment with minimal privileges.
Credited to 0x5t4l1n, dcodeIO.
References
- https://github.com/protobufjs/protobuf.js/security/advisories/GHSA-f84p-cvgm-xgjj
- https://github.com/protobufjs/protobuf.js/releases/tag/protobufjs-cli-v1.2.1
- https://github.com/protobufjs/protobuf.js/releases/tag/protobufjs-cli-v2.0.2
- https://nvd.nist.gov/vuln/detail/CVE-2026-42290
- https://github.com/advisories/GHSA-f84p-cvgm-xgjj
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-54269
protobufjs : Schema-derived names can shadow runtime-significant properties
medium5.3Jun 15, 2026CVE-2026-54271
protobufjs-cli: Code injection in pbjs static output from crafted JSON descriptor names
high8.2Jun 15, 2026CVE-2026-44295
protobuf.js: Code injection in pbjs static output from crafted schema names
high8.7May 12, 2026
