CVE-2026-41242: protobufjs code injection in protobuf definitions

CVE-2026-41242 · Severity: critical · CVSS 9.8 · Published 2026-04-18

protobufjs is a popular library used to handle data serialization in JavaScript applications. A vulnerability exists where the library fails to properly sanitize data types when loading configuration files. If an application allows users to provide their own data definitions, an attacker could inject malicious code that executes on the server or in the user's browser, potentially leading to a full system takeover.

Technologies: protobufjs (npm). Vendors: npm.

Quick answers

Is CVE-2026-41242 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-41242 being exploited in the wild.
How severe is CVE-2026-41242?
Critical severity, with a CVSS score of 9.8, published 18 April 2026.
Which products and versions are affected?
protobufjs (npm) >= 8.0.0, < 8.0.1, SEMVER:introduced=8.0.0,fixed=8.0.1.
Is there a fix for CVE-2026-41242?
Yes. protobufjs (npm): upgrade to 8.0.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-41242 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-41242?
Check whether you run protobufjs (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • protobufjs (npm): upgrade to 8.0.1 or later
    npm install protobufjs@8.0.1

Technical details

A code injection vulnerability exists in protobufjs due to improper control of generation of code (CWE-94). The library compiles protobuf definitions into JavaScript functions; however, it fails to validate the "type" fields within these definitions or JSON descriptors. An attacker who can influence the protobuf schema or descriptor loaded via reflection APIs can inject arbitrary JavaScript code. This code is subsequently executed during object decoding or other operations on the loaded type. The issue is resolved in versions 7.5.5 and 8.0.1 by implementing a regex filter to ensure type names only contain alphanumeric characters.

Affected products

  • protobufjs protobufjs < 7.5.5, 8.0.0

Identifiers

  • CVE-2026-41242
  • GHSA-xq3m-2v4x-88gg

Timeline

  • 2026-03-11: patched: Version 8.0.1 released
  • 2026-04-16: advisory: GitHub Security Advisory published
  • 2026-04-17: patched: Version 7.5.5 released
  • 2026-04-18: disclosed: CVE published to NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.