CVE-2026-114129 is an algorithmic-complexity (CWE-407) denial-of-service in the stream-json npm package's FlexAssembler component. The root cause is that when a rule filter is a string or RegExp, the compileFilter helper compiles it into a matcher that runs keyStack.join(separator) (string branch) or filter.test(keyStack.join(separator)) (RegExp branch) on every container start. Because the key stack grows one entry per open object/array with no depth bound, a JSON document nested to depth D drives D container-start tokens, each performing an O(D) join, for O(D^2) total CPU on the single-threaded event loop.
The two fix commits confirm the vulnerable code path:
- Commit 1929fd8 ("Added depth capping for DoS hardening") added a
maxDepth option (default 1024) and a RangeError guard in _matchRule, bounding the key stack depth.
- Commit c06c9a3 ("Perf optimization") went further and removed the per-check join entirely by introducing an internal
PathMatcher (src/core/utils/path-matcher.js) that maintains per-level state (prefix-match state for strings, accumulated path for RegExp) instead of joining the full stack on every check.
The vulnerable functions are all in src/core/utils/flex-assembler.js (re-exported at stream-json/utils/flex-assembler.js and stream-json/web/utils/flex-assembler.js):
compileFilter — the module-level helper that performs the O(depth) join in its string and RegExp branches.
FlexAssembler._matchRule — the hot path that invokes the compiled filter for every rule on every container start.
FlexAssembler._pushState — pushes onto the unbounded key stack.
FlexAssembler.startObject and FlexAssembler.startArray — the container-start entry points that trigger the push and match.
These are JavaScript (Node.js) functions, so a profiler would show them as FlexAssembler.startObject, FlexAssembler._matchRule, etc. (class method names without a namespace/module path), while compileFilter is a module-level function shown as compileFilter.