1 line
2.2 KiB
JSON
1 line
2.2 KiB
JSON
{"id": "GHSA-36hh-x5p5-jgc8", "cve": "CVE-2026-44974", "repo": "hapijs/content", "cwes": ["CWE-436"], "vuln_files": ["lib/index.js"], "duration_sec": 143.2, "error": null, "strict": false, "lenient": false, "findings_scored": [{"fileMatch": true, "lineProx": false, "cweMatch": false, "hit": false, "title": "ReDoS (quadratic backtracking) in Content-Disposition parameter parsing", "file": "lib/index.js", "line": 88, "cwe": "CWE-1333"}], "n_findings": 1, "findings": [{"title": "ReDoS (quadratic backtracking) in Content-Disposition parameter parsing", "file": "lib/index.js", "line": 88, "cwe": "CWE-1333", "vuln_class": "dos", "severity": "high", "description": "exports.disposition() validates the header against contentDispositionRegex (line 96), extracts the parameter substring (match[1]), and then runs the global regex internals.contentDispositionParamRegex (line 88) over it via String.replace at line 107. That regex starts with the greedy group ([^\\=\\*\\s]+) which must then be followed by \\s*\\=. When attacker input contains a long run of non-'=', non-'*', non-whitespace characters that never contains an '=' (e.g. 'form-data; aaaaa...'), the greedy group matches the whole run, fails to find '=', and because the regex is global, String.replace re-attempts the match starting at every subsequent position. Each attempt does O(n) work, yielding O(n^2) total time with no upstream length limit in this module. Measured: 20k chars = 0.3s, 40k = 1.3s, 80k = 5.3s, 100k = 8.2s, 200k = 32s. This synchronously blocks the single-threaded Node.js event loop. The header value is fully attacker-controlled and reaches the sink without any length/complexity sanitizer (the only pre-checks are __proto__ guards and the form-data prefix match, neither of which limits input size).", "poc": "Send a multipart request whose part Content-Disposition header (or call Content.disposition() directly) is: 'form-data; ' followed by ~100000 'a' characters with no '=' sign. Example: Content.disposition('form-data; ' + 'a'.repeat(100000)) blocks the event loop for ~8 seconds; scaling the length increases the stall quadratically, enabling a single small-ish request to cause sustained denial of service.", "confidence": 0.9}], "transcript": ""} |