CVE-2026-44295: Protobufjs cli Code Injection Vulnerability

HIGH
Advisory Identifier: GHSA-6r35-46g8-jcw9
CVSS 8.7
CWE-94
Published
Advisory Summary

CVE-2026-44295 is a HIGH (CVSS 8.7) 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 schema names. Remediation is available by upgrading affected packages to version 1.2.1, 2.0.2.

CVE-2026-44295 at a Glance

CVE Identifier CVE-2026-44295
GHSA Identifier GHSA-6r35-46g8-jcw9
Severity HIGH
CVSS v3.1 Base Score 8.7
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Protobufjs cli
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-44295

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.

protobufjs-cli fixed: 1.2.1
npm install protobufjs-cli@1.2.1
protobufjs-cli fixed: 2.0.2
npm install protobufjs-cli@2.0.2
Verify Direct and Transitive Dependencies

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-44295, 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.2.1), 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

## 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 `pbjs` static 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.

CVE-2026-44295 Affected Protobufjs cli Versions

2 component(s)
Fixed Versions:
1.2.12.0.2
Product / Package Ecosystem Affected Versions Fixed Version
protobufjs-cli
npm
< 1.2.1
1.2.1
protobufjs-cli
npm
≥ 2.0.0
< 2.0.2
2.0.2

References

Frequently Asked Questions

What is CVE-2026-44295?
CVE-2026-44295 is a security vulnerability in Protobufjs cli involving Code injection in pbjs static output from crafted schema names under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Protobufjs cli versions are affected?
Affected versions include releases prior to 1.2.1, 2.0.2 across affected packages: protobufjs-cli.
What version fixes CVE-2026-44295?
Upgrading to 1.2.1, 2.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is protobufjs-cli affected?
Yes, protobufjs-cli is affected in releases prior to 1.2.1, 2.0.2. Upgrade your dependency to 1.2.1, 2.0.2 or later.
What is the CVSS score of CVE-2026-44295?
CVE-2026-44295 has a CVSS v3.1 base score of 8.7 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2026-44295?
CVE-2026-44295 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (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.).
How can I check npm dependencies for CVE-2026-44295?
Run the dependency tree command: 'npm ls protobufjs-cli'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6r35-46g8-jcw9",
  "modified" : "2026-05-14T20:35:26Z",
  "published" : "2026-05-12T15:06:22Z",
  "aliases" : [ "CVE-2026-44295" ],
  "summary" : "protobuf.js: Code injection in pbjs static output from crafted schema names",
  "details" : "## Summary\n\n`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.\n\n## Impact\n\nAn 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.\n\nThis 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.\n\n## Preconditions\n\n- The application or build process must run `pbjs` static code generation on a schema or JSON descriptor influenced by an attacker.\n- The attacker-controlled input must contain crafted schema names that reach generated JavaScript output.\n- The generated JavaScript file must subsequently be executed, imported, or otherwise evaluated.\n\n## Workarounds\n\nDo 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "protobufjs-cli"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.2.0"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "protobufjs-cli"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.0.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/protobufjs/protobuf.js/security/advisories/GHSA-6r35-46g8-jcw9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-44295"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/protobufjs/protobuf.js"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/protobufjs/protobuf.js/releases/tag/protobufjs-cli-v1.2.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/protobufjs/protobuf.js/releases/tag/protobufjs-cli-v2.0.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-12T15:06:22Z",
    "nvd_published_at" : "2026-05-13T16:16:56Z"
  }
}