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-71498

CVE-2026-71498: Out-of-bounds Heap Read in node-re2 via Truncated Multi-byte UTF-8 Characters

Alon Barad
Alon Barad
Software Engineer

Aug 7, 2026·6 min read·31 visits

Executive Summary (TL;DR)

Passing a raw Node.js Buffer ending in a truncated multi-byte UTF-8 byte to node-re2 (< 1.26.1) causes a 3-byte heap over-read, leaking adjacent heap memory back to the JavaScript runtime.

A medium-severity out-of-bounds (OOB) heap read vulnerability exists in node-re2 prior to version 1.26.1. When a raw binary Node.js Buffer with a truncated multi-byte UTF-8 character at its end is passed to the C++ native addon, the internal lookahead routine getUtf8CharSize() over-reads up to 3 bytes from the heap, leading to memory disclosure.

Vulnerability Overview

CVE-2026-71498 describes a medium-severity out-of-bounds heap read vulnerability affecting node-re2, the Node.js native bindings for Google's RE2 regular expression library. The flaw is present in versions of the re2 npm package prior to 1.26.1. It manifests when processing raw binary Node.js Buffer objects that terminate with a truncated or incomplete multi-byte UTF-8 character sequence.

While standard JavaScript strings are subjected to validation and sanitization by the V8 engine during serialization, Node.js Buffer objects bypass this layer. Consequently, raw and malformed byte sequences are passed directly to the underlying C++ addon. When the native library attempts to parse these sequences, it fails to validate internal pointer boundaries against the physical allocation limits of the buffer.

The vulnerability resides within the utility function used to compute character sizes based on the lead byte. If an input buffer ends abruptly with a lead byte indicating a multi-byte sequence, the module attempts to read forward by the declared character width. This causes the application to read past the end of the allocated buffer, exposing adjacent memory segments on the heap.

Root Cause Analysis

The root cause of CVE-2026-71498 is a lack of boundary verification in the native utility functions of the node-re2 module. The module relies on the fast-path helper function getUtf8CharSize(char ch) defined inside lib/wrapped_re2.h to determine the length of a UTF-8 character sequence. This function determines character width solely by inspecting the bit patterns of the leading byte.

For instance, when encountering a byte with the high bits 11110xxx (such as 0xF0), the bitwise algorithm concludes that the character spans four bytes. This logic operates under the assumption that the input data represents a valid, well-formed UTF-8 stream. It contains no parameters or logical checks to account for the actual remaining length of the memory allocation.

When a truncated sequence is processed, such as a buffer of size 2 ending in 0xF0, the lookahead mechanism is triggered. The iteration loop determines that there is still one byte remaining to process, satisfying basic index checks. However, once getUtf8CharSize returns a size of 4, the application copies four bytes starting from the truncated lead byte, causing a three-byte out-of-bounds read.

Code Analysis

The vulnerable version of node-re2 exposes several file-level callsites where the lookahead check is executed without size boundaries. In files such as lib/replace.cc, lib/split.cc, and lib/pattern.cc, character parsing routines call getUtf8CharSize(ch) with only the character value.

The following code block highlights the vulnerable construction in lib/replace.cc where the over-read occurs:

// Vulnerable path in lib/replace.cc
else if ((size_t)offset < size) {
    // getUtf8CharSize only receives the character byte
    auto sym_size = getUtf8CharSize(data[offset]);  
    // Reads sym_size bytes from current offset, overshooting buffer bounds
    result.append(data + offset, sym_size);         
    byteIndex = offset + sym_size;
}

The issue is resolved in version 1.26.1 by overloading the helper function in lib/wrapped_re2.h to accept the remaining size of the buffer. The new implementation dynamically clamps the returned character size to the actual bytes left in the allocation.

// Patched helper in lib/wrapped_re2.h
inline size_t getUtf8CharSize(char ch, size_t remaining)
{
    size_t size = getUtf8CharSize(ch);
    // Clamps the return value to prevent reading beyond allocation limits
    return size < remaining ? size : remaining; 
}

With this change, all callsites within lib/replace.cc, lib/split.cc, and lib/pattern.cc were updated to calculate the remaining bounds and supply this as the second parameter. For example, getUtf8CharSize(ch) was replaced with getUtf8CharSize(ch, size - i). This modification prevents any possibility of reading past the allocated memory buffer.

Exploitation Methodology

Exploitation of CVE-2026-71498 requires that an application use node-re2 to process untrusted binary input via a Node.js Buffer. The attacker must be able to control or manipulate the contents of the buffer so that it ends with a truncated multi-byte UTF-8 character. Common execution paths include processing user-uploaded file buffers, network packet payloads, or raw stream segments.

No complex heap layout manipulation or administrative privileges are required to trigger the vulnerability. When the malformed buffer is supplied to functions like replace(), split(), or compiled as a pattern using new RE2(), the C++ layer over-reads up to 3 bytes from adjacent heap space.

The leaked adjacent heap bytes are written into the output structure of the operation and returned to the JavaScript runtime as a new Buffer or String. An attacker can repeat this process systematically to leak sequential chunks of heap memory. This can lead to the exposure of sensitive session tokens, internal system variables, or private cryptographic keys stored in memory.

Impact Assessment

The security impact of CVE-2026-71498 is categorized as an information disclosure vulnerability with a CVSS v3.1 base score of 5.1. The confidentiality impact is rated as low because the leakage is limited to a maximum of three bytes per execution. However, because the vulnerability can be triggered repeatedly in a loop, an attacker can reconstruct larger memory segments over time.

In certain execution environments, reading past the boundaries of the heap allocation can trigger a segmentation fault or a memory access violation. This occurs if the out-of-bounds read crosses a memory page boundary into unmapped or protected address space. Under these conditions, the vulnerability can be leveraged to cause a denial-of-service (DoS) condition by crashing the Node.js process.

The vulnerability is local in scope because it requires interaction with a local instance of the node-re2 library. However, if a network-facing Node.js application accepts raw binary uploads and passes them to node-re2, the vulnerability becomes exposable remotely. This expands the operational threat profile of the bug.

Remediation & Patching

The primary remediation path for CVE-2026-71498 is upgrading the re2 npm package to version 1.26.1 or later. This version incorporates the overloaded, boundary-aware getUtf8CharSize checks which mitigate the out-of-bounds reading behavior across all affected native source files.

If upgrading the dependency is not immediately feasible, developers can implement an input sanitation workaround. Before passing any raw Node.js Buffer to a node-re2 function, convert it to a standard JavaScript UTF-8 string. This forces the V8 engine to serialize the input and discard or replace truncated multi-byte characters safely.

// Mitigation wrapper example
function safeReplace(re2Instance, rawBuffer, replacement) {
    // Converts buffer to string, neutralizing truncated multi-byte characters
    const sanitizedInput = rawBuffer.toString('utf8');
    return re2Instance.replace(sanitizedInput, replacement);
}

Organizations should also verify their dependency trees to ensure transitive dependencies utilizing node-re2 are identified and updated. Static analysis tools and software bill of materials (SBOM) scanning can help isolate legacy versions of the package.

Fix Analysis (3)

Technical Appendix

CVSS Score
5.1/ 10
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L

Affected Systems

node-re2 (npm package: re2) running on Node.js runtime environments

Affected Versions Detail

Product
Affected Versions
Fixed Version
re2
uhop
< 1.26.11.26.1
AttributeDetail
CWE IDCWE-125 (Out-of-bounds Read)
Attack VectorLocal
CVSS v3.15.1 (Medium)
Exploit StatusPoC (Proof-of-Concept) documented
KEV StatusNot Listed
Impact TypeInformation Disclosure / Memory Leakage

MITRE ATT&CK Mapping

T1005Data from Local System
Collection
CWE-125
Out-of-bounds Read

The product reads data past the end, or before the beginning, of the intended buffer.

Known Exploits & Detection

GitHub Issue #272Demonstration of Buffer with trailing lead byte causing length inflation

References & Sources

  • [1]GitHub Security Advisory GHSA-j4r3-hg7j-8chg
  • [2]node-re2 GitHub Issue #272

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

•1 day ago•CVE-2026-58254
6.5

CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections

NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.

Alon Barad
Alon Barad
8 views•10 min read
•1 day ago•CVE-2026-63341
7.5

CVE-2026-63341: Unauthenticated Denial of Service via Unbounded Topic Depth in Aedes MQTT Broker

CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.

Alon Barad
Alon Barad
14 views•12 min read
•1 day ago•CVE-2026-61725
6.1

CVE-2026-61725: Path Traversal and Arbitrary File Overwrite in sevenz-rust2

CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.

Alon Barad
Alon Barad
6 views•12 min read
•1 day ago•CVE-2026-77309
8.8

CVE-2026-77309: Unauthenticated Remote Code Execution in NASA-AMMOS AIT-GUI via Incomplete File Cleanup and Path Traversal

CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.

Amit Schendel
Amit Schendel
13 views•10 min read
•1 day ago•CVE-2026-77332
2.3

CVE-2026-77332: Surfaced-Memory Envelope Injection and Stored Prompt Injection in memtomem-stm

A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.

Alon Barad
Alon Barad
17 views•10 min read
•2 days ago•CVE-2026-77331
2.0

CVE-2026-77331: Race Condition and Session State Corruption in memtomem-stm

CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.

Amit Schendel
Amit Schendel
8 views•9 min read