CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-41242

CVE-2026-41242: Remote Code Execution via Code Injection in protobufjs

Amit Schendel
Amit Schendel
Senior Security Researcher

Apr 21, 2026·5 min read·168 visits

Executive Summary (TL;DR)

protobufjs versions prior to 7.5.5 and 8.0.1 suffer from a code injection vulnerability (CWE-94) during dynamic code generation. Attackers can achieve RCE by supplying crafted Protobuf definitions containing unsanitized JavaScript syntax in type names.

A critical remote code execution vulnerability in the protobufjs package allows unauthenticated attackers to execute arbitrary JavaScript within the Node.js runtime environment via maliciously crafted schema definitions.

Vulnerability Overview

The protobufjs library is a widely adopted Node.js package that provides protocol buffer serialization and deserialization capabilities. Many modern architectures rely on protocol buffers for efficient inter-service communication and data storage. The library handles parsing .proto files and JSON descriptor objects to construct message schemas dynamically at runtime.

CVE-2026-41242 is a critical Improper Control of Generation of Code vulnerability (CWE-94) located within the schema processing logic of the package. The flaw manifests when the library dynamically generates encoding and decoding routines to optimize processing performance. This optimization technique relies on Just-In-Time (JIT) compilation of JavaScript strings.

An attacker who can control the schema definition processed by the application can inject arbitrary JavaScript into these generated routines. Execution of this injected code occurs within the context of the running Node.js process. This results in complete system compromise if the node process runs with sufficient privileges.

Root Cause Analysis

To achieve high throughput, protobufjs constructs specialized encoding and decoding functions on the fly for each processed schema. The library concatenates static JavaScript code templates with dynamic variables derived from the parsed schema. These concatenated strings are subsequently instantiated into executable routines using the JavaScript new Function() constructor.

The vulnerability stems from an absolute lack of input sanitization during this string concatenation phase. The library directly interpolates metadata properties extracted from the user-supplied schema into the executable code string. Specifically, the type and name properties of a nested schema type are placed into the code without escaping or validation.

When the JavaScript runtime attempts to compile the output of the new Function() constructor, it parses the entire string as code. An attacker can construct a schema where the name property contains characters that break out of the intended string or variable context. By inserting characters such as closing parentheses, semicolons, and curly braces, the attacker defines new lexical boundaries and inserts arbitrary executable statements.

Code Analysis and Patch Review

The vulnerability was addressed by introducing a rigorous sanitization step within the type instantiation logic. Maintainers released patch commits, specifically 535df444ac060243722ac5d672db205e5c531d75 for the main branch and ff7b2afef8754837cc6dc64c864cd111ab477956 for the 7.x release line.

The core fix resides in src/type.js. The vulnerable implementation accepted the name parameter directly from the parsed descriptor and passed it unmodified into the namespace constructor. The patched version applies a strict regular expression filter to strip any non-alphanumeric characters.

// src/type.js - Patched Implementation
function Type(name, options) {
+   // Strips non-alphanumeric/underscore characters to prevent syntax breakout
+   name = name.replace(/\W/g, ""); 
    Namespace.call(this, name, options);
// ...

This mitigation forces the name string to conform strictly to valid JavaScript identifier constraints. Any structural characters required for an injection attack are silently removed before the string reaches the new Function() sink. The following diagram illustrates the patched execution flow.

Exploitation Methodology

Exploiting CVE-2026-41242 requires the attacker to supply a malicious Protobuf descriptor to a vulnerable application endpoint. The attack sequence typically begins with the application invoking protobuf.Root.fromJSON() or parsing an equivalent .proto file containing untrusted input. The exploit payload targets the namespace identifier structure.

The provided proof-of-concept payload defines a nested type with an extensively crafted string as its key. The string ExploitType; (function(){ console.log('RCE_EXECUTED'); require('child_process').execSync('touch /tmp/pwned'); })(); // serves as the malicious name property. When the library evaluates this schema, the compilation process maps this key directly into the uncompiled source text.

const maliciousDescriptor = {
  nested: {
    "ExploitType; (function(){ require('child_process').execSync('touch /tmp/pwned'); })(); //": {
      fields: { someField: { type: "string", id: 1 } }
    }
  }
};

The initial ExploitType; terminates the preceding logical statement inside the dynamically generated function. The subsequent immediately invoked function expression contains the arbitrary commands, executed instantly upon compilation. The trailing // neutralizes any trailing code appended by the template, preventing syntax errors that would halt execution.

Impact Assessment

Successful exploitation of CVE-2026-41242 yields unauthenticated Remote Code Execution (RCE). The injected JavaScript commands inherit the execution context and permissions of the hosting Node.js application. This access level permits the execution of arbitrary system commands, direct interaction with the underlying filesystem, and access to process environment variables.

The primary attack vector involves network services that accept dynamic schema definitions. Multi-tenant environments, plugin architectures, and systems processing serialized data from untrusted repositories represent the highest risk profiles. Applications statically loading trusted schemas at startup remain vulnerable only if an attacker compromises the schema repository.

The vulnerability possesses a CVSS v4 score of 9.4, reflecting its minimal attack complexity and severe impact metrics. The public availability of functional exploit repositories elevates the probability of widespread scanning and exploitation attempts targeting internet-facing Node.js services.

Remediation and Mitigation

The fundamental remediation strategy requires updating the protobufjs dependency to a secured version. Organizations must upgrade to version 7.5.5 or 8.0.1 immediately. Dependency trees should be audited using package management tools to identify transitive dependencies relying on vulnerable versions of the library.

Applications must enforce strict boundary validation for all external inputs. Protobuf definitions and JSON descriptors must not be loaded from untrusted network sources or unauthenticated users. If dynamic schema loading is a rigid business requirement, implement strict schema structure validation before passing the data to the protobufjs parser.

Employing defense-in-depth measures limits the blast radius of a successful exploit. Execute Node.js processes with least-privilege service accounts to restrict filesystem and network access. Implement system-level sandboxing, such as seccomp profiles or restricted container capabilities, to prevent child process execution.

Official Patches

GitHub Security AdvisoryOfficial GHSA publication with patch details.

Fix Analysis (2)

Technical Appendix

CVSS Score
9.4/ 10
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
EPSS Probability
0.05%
Top 85% most exploited

Affected Systems

Node.js services processing dynamic Protobuf schemasMulti-tenant RPC servers utilizing protobufjsApplications loading schema definitions from external APIs

Affected Versions Detail

Product
Affected Versions
Fixed Version
protobufjs
protobufjs
< 7.5.57.5.5
protobufjs
protobufjs
>= 8.0.0-experimental, < 8.0.18.0.1
AttributeDetail
CWE IDCWE-94
CVSS Score9.4
Attack VectorNetwork
EPSS Percentile15.37%
Exploit StatusPoC Available
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1059Command and Scripting Interpreter
Execution
T1203Exploitation for Client Execution
Execution
CWE-94
Improper Control of Generation of Code

Improper Control of Generation of Code ('Code Injection')

Known Exploits & Detection

GitHubProof of Concept repository demonstrating RCE via malicious descriptor.
NucleiDetection Template Available

Vulnerability Timeline

Vulnerability reported to maintainers.
2026-03-02
Fix commits pushed to GitHub repository.
2026-03-11
Release of patched version 7.5.5.
2026-04-15
Detailed technical analysis published by Endor Labs.
2026-04-17
CVE-2026-41242 and GHSA officially published.
2026-04-18

References & Sources

  • [1]GHSA-xq3m-2v4x-88gg Advisory
  • [2]Exploit Proof of Concept

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•6 minutes ago•CVE-2026-63376
8.2

CVE-2026-63376: Prototype Pollution via Path Desynchronization in toml-node

A prototype pollution vulnerability exists in the toml-node library (by BinaryMuse) in versions prior to 4.1.2. The flaw arises from inconsistent internal tracking of parsed paths (comma-joined vs. dot-joined serialization) combined with lack of object ownership validation during recursive dictionary descent (scalar descent). This allows unauthenticated remote attackers to modify base object structures by crafting malicious TOML documents containing conflicting duplicate table paths or nested references.

Alon Barad
Alon Barad
0 views•6 min read
•about 1 hour ago•CVE-2026-69083
10.0

CVE-2026-69083: Unauthenticated SQL Injection and SQL Command Execution in SiYuan Full-Text Search API

An unauthenticated SQL injection and SQL execution vulnerability in SiYuan allows remote attackers to compromise the integrity and confidentiality of the asset database. The flaw exists due to string concatenation in regular expression searches and a complete lack of authorization checks on raw SQL querying pathways under default configurations. Attackers can leverage this vulnerability to exfiltrate database contents, manipulate index records, or access cross-notebook contents without any valid credentials.

Alon Barad
Alon Barad
2 views•6 min read
•about 2 hours ago•CVE-2026-68587
9.2

CVE-2026-68587: Broken Access Control in SiYuan Note Transaction Endpoints

CVE-2026-68587 is a critical authorization bypass vulnerability in SiYuan, an open-source personal knowledge management workspace. When deployed in publish mode, specific transaction endpoints fail to perform administrative role validation. This omission enables unauthenticated remote readers to retrieve the rendered Document Object Model (DOM) of publish-disabled (private) documents by supplying a target heading block identifier. Upgrading to version v3.7.3 or later resolves this issue by applying appropriate routing middleware constraints.

Amit Schendel
Amit Schendel
5 views•6 min read
•about 3 hours ago•CVE-2026-68586
9.2

CVE-2026-68586: Missing Authorization in SiYuan Backlink Content Endpoints Allows Information Disclosure

SiYuan is a privacy-first personal knowledge management system. In versions prior to v3.7.3, the application fails to apply publish-access filters to the getBacklinkDoc and getBackmentionDoc content endpoints (/api/ref/getBacklinkDoc and /api/ref/getBackmentionDoc). While the corresponding backlink list endpoints correctly filter out publish-forbidden documents, the content endpoints, which are only gated by high-level route authorization checks via CheckAuth, do not. Consequently, a user with low-privilege read access, or an anonymous reader when publish Basic Auth is disabled, can directly invoke these endpoints using a known publish-forbidden document's ID to retrieve its rendered DOM content or determine whether it references a specific target block.

Amit Schendel
Amit Schendel
3 views•7 min read
•about 4 hours ago•CVE-2026-68585
5.8

CVE-2026-68585: Metadata Disclosure via Missing Authorization in SiYuan API

A metadata disclosure vulnerability exists in SiYuan prior to version v3.7.3. The /api/block/getBlockInfo endpoint fails to validate authorization boundaries in publish mode, allowing anonymous readers to access private document metadata.

Alon Barad
Alon Barad
6 views•8 min read
•about 5 hours ago•CVE-2026-72812
6.5

CVE-2026-72812: Broken Access Control and SQL Injection in SiYuan

A critical authorization bypass vulnerability exists in SiYuan personal knowledge management system before v3.7.4. The /api/ref/refreshBacklink endpoint lacks administrative role verification, enabling unauthenticated users to initiate database transactions and disk operations. When combined with an unsafe SQL generation pattern in nested backlink queries, an attacker can exploit a secondary SQL injection vulnerability to compromise local databases or cause denial-of-service conditions.

Amit Schendel
Amit Schendel
4 views•6 min read