NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2026-41242: Arbitrary code execution in protobufjs

criticalCVSS 4.0 9.4 · 3.1 9.8GHSA-xq3m-2v4x-88gg

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.

Published Apr 16, 2026 · Updated May 4, 2026

Affected packages

protobufjs

Ecosystem
npm
Affected
>= 8.0.0, < 8.0.1
Fixed in
8.0.1
Check
npm ls protobufjs

protobufjs

Ecosystem
npm
Affected
< 7.5.5
Fixed in
7.5.5
Check
npm ls protobufjs

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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.

Credited to cristianstaicu, alexander-fenster, sofisl.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology