Advisory

GHSA-xq3m-2v4x-88gg

Also known as: CVE-2026-41242

Summary

protobufjs has an arbitrary code execution issue

Details

Summary

protobufjs could execute generated JavaScript code derived from protobuf schema metadata. When loading a crafted JSON descriptor, schema-controlled type names and type references could reach runtime code generation without sufficient validation.

Impact

An attacker who can provide a malicious protobuf definition or JSON descriptor to an application may be able to execute arbitrary JavaScript in the context of the process using protobufjs.

This requires control over the protobuf schema or descriptor being loaded. Applications that only decode messages using trusted, application-defined schemas are not directly affected by this issue.

Preconditions

  • The application must allow an attacker to control or influence a protobuf definition or JSON descriptor.
  • The application must load that definition through protobufjs reflection APIs such as descriptor loading.
  • The affected generated-code path must be reached, for example by performing an operation on the loaded type.

Workarounds

Do not load protobuf definitions or JSON descriptors from untrusted sources with affected versions. If untrusted schemas must be accepted, validate or restrict them before loading and run schema processing in an isolated environment.

Severity

Critical Basis: The source's own band: CRITICAL

Dates

Published
2026-04-16 22:34 UTC
Modified
2026-11-04 17:28 UTC

Affected packages and fixes

protobufjs

npm · All systems

Affected

  • introduced 8.0.0, fixed 8.0.1 (semver)

Fixed versions

8.0.1

Fix

protobufjs

npm · All systems

Affected

  • introduced 7.0.0, fixed 7.5.5 (semver)

Fixed versions

7.5.5

Fix

protobufjs

npm · All systems

Affected

  • introduced 0, fixed 6.11.6 (semver)

Fixed versions

6.11.6

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences