Vulnerability in stream-json (CVE-2026-104182)
Summary
Vulnerability in stream-json (CVE-2026-104182). Risk of unauthorized operations or information disclosure. Exploitable via handleComment. Mitigation: upgrade to 3.6.0 or later.
Original description
The description as published by the source.
Summary
The JSONC parser (stream-json/jsonc/parser.js) and verifier (stream-json/jsonc/verifier.js) scan a comment for its terminator starting from the comment's opening / on every input chunk. When a comment doesn't finish inside the current buffer, the scanner returns the comment's start offset and the buffer keeps the whole comment, so the next chunk re-scans everything seen so far. A single comment of length n delivered across many chunks costs O(n²) CPU.
This is the same class as GHSA-528h-pc64-c93x (path filters, medium, CWE-407): an algorithmic-complexity re-scan in a streaming feature. It's a different code path though — the comment scanner in handleComment, which the 3.5.0 depth cap doesn't touch — so upgrading past that advisory doesn't help here. The plain JSON parser is fine: its strings and numbers advance and drop consumed bytes, and only comments retain and re-scan.
Proof of concept
npm i stream-json@3.5.0
import Parser from 'stream-json/jsonc/parser.js';
function feed(N) {
return new Promise(resolve => {
const stream = Parser.asStream(); // default options
stream.on('data', () => {});
stream.on('error', () => {});
stream.on('end', resolve);
const doc = '/*' + 'a'.repeat(N) + '*/1'; // one valid, closed comment
for (let i = 0; i < doc.length; i += 16384) // 16 KB pieces, as a socket delivers a body
stream.write(doc.slice(i, i + 16384));
stream.end();
});
}
Timing the p…
Source: NIST National Vulnerability Database NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-104182 has been found in stream-json.
Attackers can target a specific entry point like handleComment over the network to misuse the product.
Risk of unauthorized operations or information disclosure. CVSS score: 6.2/10.
What to do: upgrade stream-json to 3.6.0 or later.
If unsure, ask your IT team or search "stream-json CVE-2026-104182" on the vendor's site.
CVE-2026-104182 (stream-json) — CWE-407 / CVSS v3 6.2
Attack vector: local / unauthenticated / no user interaction
Attack surface: handleComment / startComment / commentChunk / endComment
Patched: 3.6.0 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-407) exists in stream-json. Attackers reach the vulnerable code path via handleComment without authentication.
Check the vendor advisory for the affected versions of stream-json. Attack surface: handleComment / startComment / commentChunk / endComment.
Severity: Medium (CVSS 6.2/10). Risk of unauthorized operations or information disclosure.
Update to 3.6.0.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'stream-json' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'stream-json' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
stream-jsonを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade stream-json to 3.6.0ステージング環境で 3.6.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- web github.com
- web github.com
- web github.com
- web nvd.nist.gov
- web github.com