---
id: "CVE-2026-41242"
kind: "vulnerability"
aliases: ["CVE-2026-41242", "GHSA-xq3m-2v4x-88gg"]
title: "protobufjs has an arbitrary code execution issue"
severity: "critical"
cvss: 9.8
epss: 0.00774
exploited: false
status: "open"
category: "package"
products: [{"name": "protobufjs", "fixed": ["8.0.1"], "affected": ">= 8.0.0, < 8.0.1", "ecosystem": "npm"}, {"name": "protobufjs", "fixed": ["7.5.5"], "affected": ">= 7.0.0, < 7.5.5", "ecosystem": "npm"}, {"name": "protobufjs", "fixed": ["6.11.6"], "affected": "< 6.11.6", "ecosystem": "npm"}, {"name": "protobufjs project protobufjs", "fixed": ["7.5.5"], "affected": "< 7.5.5", "ecosystem": "vendor"}, {"name": "protobufjs project protobufjs", "fixed": [], "affected": "= 8.0.0", "ecosystem": "vendor"}]
ecosystems: ["npm", "vendor"]
tags: ["cwe-94", "grpc", "node.js", "npm", "package", "protobufjs"]
not_affected_if: ["managed-hosting", "no-descriptor-loading", "trusted-schemas-only"]
published_at: "2026-04-16T22:34:57+00:00"
first_seen_at: "2026-11-04T17:15:41+00:00"
updated_at: "2026-11-04T17:28:12+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-xq3m-2v4x-88gg", "first_seen_at": "2026-11-04T17:15:41+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-41242", "first_seen_at": "2026-11-04T17:28:12+00:00"}]
---

# protobufjs has an arbitrary code execution issue

protobufjs turns schema type names from a loaded protobuf definition or JSON descriptor into generated JavaScript without enough validation. An attacker who controls that schema can run arbitrary JavaScript inside the process that loads it.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:protobufjs affected >= 8.0.0, < 8.0.1 fixed 8.0.1
- npm:protobufjs affected >= 7.0.0, < 7.5.5 fixed 7.5.5
- npm:protobufjs affected < 6.11.6 fixed 6.11.6
- vendor:protobufjs project protobufjs affected < 7.5.5 fixed 7.5.5
- vendor:protobufjs project protobufjs affected = 8.0.0 fixed ?

## How to check

- Run `npm ls protobufjs` in each project to see which version is installed.
- Look for applications that load `.proto` files or JSON descriptors from users, uploads, or other untrusted sources.
- Check that the installed version is at or above the fixed version for its line.

## Fix

- `8.0.1` for the 8.0.x line
- `7.5.5` for the 7.x line
- `6.11.6` for versions below 6.11.6

## Timeline

- 2026-11-04T17:15:41+00:00 ghsa https://github.com/advisories/GHSA-xq3m-2v4x-88gg
- 2026-11-04T17:28:12+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-41242

## Documents

- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/protobufjs/protobuf.js/security-advisories/GHSA-xq3m-2v4x-88gg
- [advisory] Maintainer's advisory: github.com https://github.com/protobufjs/protobuf.js/security/advisories/GHSA-xq3m-2v4x-88gg
- [fix] Patch: github.com https://github.com/protobufjs/protobuf.js/commit/535df444ac060243722ac5d672db205e5c531d75
- [fix] Patch: github.com https://github.com/protobufjs/protobuf.js/commit/ff7b2afef8754837cc6dc64c864cd111ab477956
- [fix] Release: github.com https://github.com/protobufjs/protobuf.js/releases/tag/protobufjs-v7.5.5
- [fix] Release: github.com https://github.com/protobufjs/protobuf.js/releases/tag/protobufjs-v8.0.1
- [fix] Patch: github.com https://github.com/protobufjs/protobuf.js/commit/086916b4a52c9f73ce88956edbb38fc902e54bbf

## From the sources

## 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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
