Vulnerabilities in pkg:npm/protobufjs-cli
PACKAGECVE-2026-54271 is a HIGH (CVSS 8.2) code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting protobufjs-cli libraries in the npm ecosystem. The issue involves code injection in pbjs static output from crafted json descriptor names. Remediation is available by upgrading affected packages to version 1.3.2, 2.5.0.
pkg:npm/protobufjs-cli
Vulnerability advisories affecting package pkg:npm/protobufjs-cli. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-pr59-h9ph-3fr8 | CVE-2026-54271 | HIGH | protobufjs-cli: Code injection in pbjs static output from crafted JSON descriptor names |
| GHSA-f38q-mgvj-vph7 | CVE-2026-54269 | MODERATE | protobufjs : Schema-derived names can shadow runtime-significant properties |
| GHSA-6r35-46g8-jcw9 | CVE-2026-44295 | HIGH | protobuf.js: Code injection in pbjs static output from crafted schema names |
| GHSA-f84p-cvgm-xgjj | CVE-2026-42290 | HIGH | protobuf.js is Vulnerable to OS Command Injection in the CLI |
CVE-2026-54271 at a Glance
Security Impact
CVSS: 8.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:L).
How to Fix CVE-2026-54271
To remediate this vulnerability, upgrade all affected protobufjs-cli dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install protobufjs-cli@1.3.2
npm install protobufjs-cli@2.5.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls protobufjs-cli
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-54271, inspect your project dependencies using npm:
npm ls protobufjs-cli
Analyze the terminal output to locate any version of protobufjs-cli in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.2), your application is affected.
Note: The npm ls protobufjs-cli command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In protobufjs-cli, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-54271 Affected protobufjs-cli Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
protobufjs-cli
|
npm |
< 1.3.2
|
1.3.2
|
|
protobufjs-cli
|
npm |
≥ 2.0.0
< 2.5.0
|
2.5.0
|
References
Frequently Asked Questions
What is CVE-2026-54271?
Which protobufjs-cli versions are affected?
What version fixes CVE-2026-54271?
Is protobufjs-cli affected?
What is the CVSS score of CVE-2026-54271?
What CWE is associated with CVE-2026-54271?
How can I check npm dependencies for CVE-2026-54271?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pr59-h9ph-3fr8",
"modified" : "2026-07-15T22:06:57Z",
"published" : "2026-06-15T20:13:54Z",
"aliases" : [ "CVE-2026-54271" ],
"summary" : "protobufjs-cli: Code injection in pbjs static output from crafted JSON descriptor names",
"details" : "## Summary\n\nA 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.\n\nThis is a bypass of GHSA-6r35-46g8-jcw9 / CVE-2026-44295.\n\n## Impact\n\nAn 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.\n\nThe injected code may execute if the generated file is later executed or imported and an affected generated API path is invoked.\n\n## Preconditions\n\n* The application or build process must run `pbjs` static code generation on a pre-parsed JSON descriptor influenced by an attacker.\n* The generated JavaScript file must subsequently be executed or imported.\n* An affected generated API path must be invoked.\n\n## Workarounds\n\nDo not run affected versions of `pbjs` static or static-module generation on untrusted JSON descriptors. If untrusted JSON descriptors must be accepted, validate descriptor-derived names before code generation and reject names that could not have been produced by parsing a valid `.proto` file. Running code generation in an isolated environment can reduce impact.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "protobufjs-cli"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.3.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.3.1"
}
}, {
"package" : {
"ecosystem" : "npm",
"name" : "protobufjs-cli"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.5.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.4.2"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/protobufjs/protobuf.js/security/advisories/GHSA-pr59-h9ph-3fr8"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-54271"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/protobufjs/protobuf.js"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-15T20:13:54Z",
"nvd_published_at" : "2026-06-22T18:16:45Z"
}
}