Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-114129 Overview
CVE-2026-114129 is an algorithmic complexity vulnerability in the stream-json Node.js library, a micro-library of stream components for processing JSON and JSONC with a minimal memory footprint. The flaw affects the FlexAssembler component in versions 2.0.0 through 3.6.x, where string and regular-expression path filters compile into matchers that join the full key stack on every container start. A crafted deeply nested JSON document forces quadratic CPU consumption on the single-threaded Node.js event loop, stalling all concurrent work in the host process. The weakness is categorized under [CWE-407: Inefficient Algorithmic Complexity]. The maintainers released a fix in version 3.7.0 that introduces a default maximum nesting depth.
Critical Impact
An attacker who can submit JSON to a process using FlexAssembler with string or RegExp path filters can stall the Node.js event loop, blocking every concurrent request handled by that process.
Affected Products
- stream-json versions 2.0.0 through 3.6.x
- Node.js applications using FlexAssembler with string path filters
- Node.js applications using FlexAssembler with regular-expression path filters
Discovery Timeline
- 2026-10-21 - CVE-2026-114129 published to NVD
- 2026-10-22 - Last updated in NVD database
Technical Details for CVE-2026-114129
Vulnerability Analysis
The FlexAssembler utility in stream-json allows consumers to build custom container types (such as Map or Set) at specific JSON paths using rule objects of the form {filter, create, add, finalize?}. When a rule's filter is a string or a RegExp, the library compiles it into a matcher that joins the entire active key stack into a path string every time a new container starts. The join runs before the matcher decides whether the rule applies, so the cost is paid unconditionally on every container entry.
For a document nested to depth D, the parser emits D container-start events, and each join operates on a stack whose length grows with the current depth. The total work therefore scales as O(D²). Because Node.js executes JavaScript on a single-threaded event loop, this CPU time blocks every other task in the process, including unrelated HTTP requests, timers, and I/O callbacks.
Consumers that use only function-based filters, or no objectRules/arrayRules at all, are not affected because the compiled string/RegExp matcher path is never taken.
Root Cause
The root cause is the unconditional joining of an unbounded key stack prior to the rule-matching decision. Because the key stack grows with the attacker-controlled nesting depth, the per-event work is proportional to depth, yielding quadratic total complexity. The implementation did not previously enforce a maximum depth for rule matching, so attacker-controlled input directly dictated the inner-loop cost.
Attack Vector
Exploitation requires the attacker to submit a JSON document to a Node.js process that pipes input through FlexAssembler configured with at least one string or RegExp path filter. Knowledge of the target schema is not required because the expensive join occurs before any rule match. A minimal payload is a deeply nested sequence of opening brackets, such as a long run of [ or {"a": tokens, terminated by matching closing tokens. The following benchmark harness from the fix commit demonstrates the shape of a triggering document.
import chain from 'stream-chain';
import {Readable} from 'node:stream';
import parser from '../src/parser.js';
import FlexAssembler from '../src/utils/flex-assembler.js';
// DEPTH containers deep (default 1000, within maxDepth), then a flat run of N empty arrays
const DEPTH = +(process.env.DEPTH || 1000),
N = +(process.env.N || 5000);
const jsonData = '['.repeat(DEPTH - 1) + '[' + '[],'.repeat(N - 1) + '[]]' + ']'.repeat(DEPTH - 1);
const tokens = await new Promise((resolve, reject) => {
const result = [];
const pipeline = chain([Readable.from([jsonData]), parser()]);
pipeline.on('data', token => result.push(token));
pipeline.on('end', () => resolve(result));
pipeline.on('error', reject);
});
const run = (n, filter) => {
let out = null;
for (let i = 0; i < n; ++i) {
const asm = new FlexAssembler({arrayRules: [{filter, create: () => [], add: (a, v) => a.push(v)}]});
for (const token of tokens) asm.consume(token);
out = asm.current;
}
return out;
};
Source: GitHub Commit c06c9a3c
Detection Methods for CVE-2026-114129
Indicators of Compromise
- Sudden sustained spikes of single-core CPU usage on Node.js worker processes that ingest external JSON.
- Event loop lag metrics climbing from milliseconds into seconds with no corresponding increase in request volume.
- HTTP request queues backing up and health checks timing out while only one worker is pinned at 100% CPU.
- Inbound requests containing JSON payloads with unusual nesting depth, such as long runs of consecutive [ or { characters.
Detection Strategies
- Audit application dependencies for stream-json versions between 2.0.0 and 3.6.x and inventory every call site that constructs a FlexAssembler with string or RegExp filter values.
- Instrument the Node.js runtime with event-loop lag probes (for example, perf_hooks.monitorEventLoopDelay) and alert when p99 exceeds a service-specific threshold.
- Add an upstream JSON depth check at the HTTP or message-queue boundary and log or drop payloads exceeding a reasonable application-defined limit.
Monitoring Recommendations
- Export per-process CPU, event-loop lag, and request-latency metrics to a centralized observability platform and correlate them with request payload sizes.
- Capture a sample of JSON request bodies that exceed a configured size or depth threshold for offline inspection.
- Monitor for RangeError exceptions emitted by FlexAssembler after upgrading, as these indicate payloads that would previously have triggered the quadratic path.
How to Mitigate CVE-2026-114129
Immediate Actions Required
- Upgrade stream-json to version 3.7.0 or later in every service that consumes untrusted JSON.
- If immediate upgrade is not possible, replace string and RegExp filters in FlexAssembler rules with function filters, which are not affected.
- Enforce a maximum request body size and reject deeply nested JSON at the reverse proxy or API gateway tier.
Patch Information
The fix is shipped in stream-json 3.7.0. The patch introduces a new maxDepth option (default 1024) that bounds the nesting depth at which rules are matched. A container nested beyond maxDepth throws a RangeError when rules exist for its kind; when no rules are configured, the limit does not apply. Setting maxDepth to Infinity disables the guard. See the GitHub Security Advisory GHSA-jj87-hc4r-jwfw and the fix commit for details. The documentation update is captured in the llms.txt commit.
Workarounds
- Replace string and RegExp filter values with equivalent function filters that evaluate the key stack without unconditional joins.
- Reject or truncate JSON documents whose nesting depth exceeds an application-defined limit before they reach FlexAssembler.
- Isolate parsing of untrusted JSON in a worker thread or child process so that a stalled event loop does not block primary request handling.
# Upgrade stream-json to the patched release
npm install stream-json@^3.7.0
# Verify the installed version
npm ls stream-json
# Example: explicitly set a conservative maxDepth when constructing FlexAssembler
# const asm = new FlexAssembler({ maxDepth: 64, arrayRules: [...], objectRules: [...] });
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

