CVE-2026-54271: CWE-94: Improper Control of Generation of Code ('Code Injection') in protobufjs protobufjs-cli
CVE-2026-54271 is a high-severity code injection vulnerability in protobufjs-cli, a command line add-on for protobuf.js. Versions prior to 1.3.2 and 2.5.0 contain an incomplete fix for unsafe name handling in static code generation, allowing crafted JSON descriptor input to produce unsafe JavaScript references. This vulnerability does not affect the common case of parsing schemas from .proto files. An attacker able to influence pre-parsed JSON descriptors used in static code generation could inject attacker-controlled code that executes when the generated JavaScript file is run or imported. The issue is a bypass of a previous vulnerability CVE-2026-44295 and is fixed in versions 1.3.2 and 2.5.0.
AI Analysis
Technical Summary
protobufjs-cli versions before 1.3.2 and 2.5.0 have an incomplete fix for unsafe name handling in static code generation from JSON descriptors, allowing code injection. This vulnerability arises when attacker-controlled JSON descriptors are used to generate static JavaScript output, potentially resulting in injected code execution upon use of the generated API. The vulnerability bypasses a prior fix (CVE-2026-44295) and does not affect the typical use case of parsing .proto files. The vulnerability is identified as CWE-94 (Improper Control of Generation of Code).
Potential Impact
An attacker who can supply or influence pre-parsed JSON descriptors passed to the static code generation feature of protobufjs-cli may cause malicious JavaScript code to be injected into the generated output. This injected code could execute when the generated file is executed or imported and the affected API path is invoked, potentially leading to full compromise of the environment running the generated code. The vulnerability has a CVSS 3.1 score of 8.2, indicating high impact on confidentiality and integrity with limited availability impact.
Mitigation Recommendations
This vulnerability is fixed in protobufjs-cli versions 1.3.2 and 2.5.0. Users should upgrade to one of these versions or later to remediate the issue. Since no official remediation level or patch links are provided in the advisory, users should verify the upgrade availability from the official protobufjs project sources. Avoid using untrusted or attacker-controlled JSON descriptors as input to the static code generation feature. The common use case of parsing .proto files is not affected, so prefer this method where possible.
CVE-2026-54271: CWE-94: Improper Control of Generation of Code ('Code Injection') in protobufjs protobufjs-cli
Description
CVE-2026-54271 is a high-severity code injection vulnerability in protobufjs-cli, a command line add-on for protobuf.js. Versions prior to 1.3.2 and 2.5.0 contain an incomplete fix for unsafe name handling in static code generation, allowing crafted JSON descriptor input to produce unsafe JavaScript references. This vulnerability does not affect the common case of parsing schemas from .proto files. An attacker able to influence pre-parsed JSON descriptors used in static code generation could inject attacker-controlled code that executes when the generated JavaScript file is run or imported. The issue is a bypass of a previous vulnerability CVE-2026-44295 and is fixed in versions 1.3.2 and 2.5.0.
CVSS v3.1
Score 8.2high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
protobufjs-cli versions before 1.3.2 and 2.5.0 have an incomplete fix for unsafe name handling in static code generation from JSON descriptors, allowing code injection. This vulnerability arises when attacker-controlled JSON descriptors are used to generate static JavaScript output, potentially resulting in injected code execution upon use of the generated API. The vulnerability bypasses a prior fix (CVE-2026-44295) and does not affect the typical use case of parsing .proto files. The vulnerability is identified as CWE-94 (Improper Control of Generation of Code).
Potential Impact
An attacker who can supply or influence pre-parsed JSON descriptors passed to the static code generation feature of protobufjs-cli may cause malicious JavaScript code to be injected into the generated output. This injected code could execute when the generated file is executed or imported and the affected API path is invoked, potentially leading to full compromise of the environment running the generated code. The vulnerability has a CVSS 3.1 score of 8.2, indicating high impact on confidentiality and integrity with limited availability impact.
Mitigation Recommendations
This vulnerability is fixed in protobufjs-cli versions 1.3.2 and 2.5.0. Users should upgrade to one of these versions or later to remediate the issue. Since no official remediation level or patch links are provided in the advisory, users should verify the upgrade availability from the official protobufjs project sources. Avoid using untrusted or attacker-controlled JSON descriptors as input to the static code generation feature. The common use case of parsing .proto files is not affected, so prefer this method where possible.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-06-12T17:13:32.280Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a39735beed863c81e39624f
Added to database: 06/22/2026, 17:39:39 UTC
Last enriched: 06/22/2026, 17:54:24 UTC
Last updated: 06/23/2026, 00:49:09 UTC
Views: 9
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.