protobuf.js is Vulnerable to OS Command Injection in the CLI
Published 12 May 2026 · Updated 10 Sept 2026
Affected packages
- Affected
- <1.2.1
- Fixed in
- 1.2.1
npm install protobufjs-cli@1.2.1- Affected
- >=2.0.0 <2.0.2
- Fixed in
- 2.0.2
npm install protobufjs-cli@2.0.2Details
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.
Is GHSA-f84p-cvgm-xgjj in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected protobufjs-cli, and gives you the command that fixes it.
References
- Linkgithub.com/protobufjs/protobuf.js/security/advisories/GHSA-f84p-cvgm-xgjj
- Advisorynvd.nist.gov/vuln/detail/CVE-2026-42290
- Packagegithub.com/protobufjs/protobuf.js
- Linkgithub.com/protobufjs/protobuf.js/releases/tag/protobufjs-cli-v1.2.1
- Linkgithub.com/protobufjs/protobuf.js/releases/tag/protobufjs-cli-v2.0.2
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.