8.7high
protobufjs-cli: Code injection in pbjs static output from crafted schema names
- Severity
- 8.7high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.40% (higher than 35% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-6r35-46g8-jcw9
Description
protobufjs-cli is the command line add-on for protobuf.js. Prior to 1.2.1 and 2.0.2, pbjs static code generation could emit unsafe JavaScript identifiers derived from schema-controlled names. When generating static JavaScript from a crafted schema or JSON descriptor, certain namespace, enum, service, or derived full names could be written into the generated output without sufficient sanitization. This vulnerability is fixed in 1.2.1 and 2.0.2.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| protobufjs protobuf.js | >= 2.0.0, < 2.0.2, < 1.2.1 | CVE List |
| protobufjs-cli (npm) | before 1.2.1, from 2.0.0 before 2.0.2 | GitHub Advisory Database |
| protobufjs_project protobufjs-cli | before 1.2.1, from 2.0.0 before 2.0.2 | NVD |
All scores
| GitHub_M | 8.7high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N |
| GitHub | 8.7high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N |
| NVD | 8.7high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
protobufjs-cli is the command line add-on for protobuf.js. Prior to 1.2.1 and 2.0.2, pbjs static code generation could emit unsafe JavaScript identifiers derived from schema-controlled names. When generating static JavaScript from a crafted schema or JSON descriptor, certain namespace, enum, service, or derived full names could be written into the generated output without sufficient sanitization. This vulnerability is fixed in 1.2.1 and 2.0.2.
GitHub Advisory Database
Summary
pbjs static code generation could emit unsafe JavaScript identifiers derived from schema-controlled names. When generating static JavaScript from a crafted schema or JSON descriptor, certain namespace, enum, service, or derived full names could be written into the generated output without sufficient sanitization.
Impact
An attacker who can provide or influence schemas passed to pbjs may be able to cause generated JavaScript output to contain attacker-controlled code. The injected code would run if the generated file is later executed or imported by the application or build process.
This affects the protobufjs CLI static code generation path. Applications that only use trusted schemas, or that do not execute generated output from untrusted schemas, are not directly affected.
Preconditions
- The application or build process must run
pbjsstatic code generation on a schema or JSON descriptor influenced by an attacker. - The attacker-controlled input must contain crafted schema names that reach generated JavaScript output.
- The generated JavaScript file must subsequently be executed, imported, or otherwise evaluated.
Workarounds
Do not run affected versions of pbjs static code generation on untrusted schemas or descriptors. If untrusted schemas must be accepted, validate schema names before code generation and run generation in an isolated environment.
NVD (es)
protobufjs-cli es el complemento de línea de comandos para protobuf.js. Antes de 1.2.1 y 2.0.2, la generación de código estático de pbjs podría emitir identificadores JavaScript inseguros derivados de nombres controlados por el esquema. Al generar JavaScript estático a partir de un esquema o descriptor JSON manipulado, ciertos nombres completos de espacio de nombres, enumeración, servicio o derivados podrían escribirse en la salida generada sin una sanitización suficiente. Esta vulnerabilidad está corregida en 1.2.1 y 2.0.2.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-44295 changed 2026-05-13 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-6r35-46g8-jcw9 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-44295 changed 2026-11-11 | Public domain |