CVE-2026-125333
`forge.http` trims response header and `Set-Cookie` values with the regular expression `/\s*$/`, which takes quadratic time on a long run of whitespace followed by another character. A server or on-path attacker can block a `forge.http` client for minutes with one large response header. Fixed in node-forge 1.4.3. ### Details `_trimString()` in `lib/http.js` removes trailing whitespace with `str.replace(/\s*$/, '')`. On a string of n whitespace characters followed by a non-whitespace character, the regular expression engine tries a match at each of the n positions and scans the rest of the run each time, so the work is O(n^2). `forge.http` calls `_trimString()` on every response header value read by `response.readHeader()`, and again on cookie names and values in `response.getCookies()`. There is no limit on header size. With Node.js 24, an 80 KB header value takes about 4 seconds to parse, and 1 MB about 10 minutes, during which the event loop (or browser tab) is blocked. `forge.http` is not loaded by `require('node-forge')`. It is part of the `forge.all` bundle and needs a socket pool provided by the application (historically Flash sockets via `forge.xhr`), so few applications use it. The fix trims trailing whitespace with a loop, as `lib/pem.js` has done since 1.4.1. The trimmed result is unchanged. #### Patches Fixed in node-forge 1.4.3. #### Workarounds Limit the size of HTTP response headers before passing them to `forge.http`, for example in the socket pool's data handler. #### Resources - Related: GHSA-7wch-p9px-956x (ReDoS in PEM decoding, fixed in 1.4.1): https://github.com/digitalbazaar/forge/security/advisories/GHSA-7wch-p9px-956x #### Severity CVSS 3.1: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H (5.9, Moderate) CVSS 4.0 (informational): CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N (8.2) CVSS 4.0 has no counterpart to 3.1's AC:H beyond AT:P and scores this higher; the severity rating follows CVSS 3.1. #### Credits Reported by
Properties
- Summary
- Forge: ReDoS in forge.http response header and cookie trimming
- Severity
- medium
- Nvd fetched at
- 2026-11-10T23:33:48.924589+00:00
- Cvss score
- 5.9
- Cvss severity
- MEDIUM
- Retrieved at
- 2026-11-10T23:34:27+00:00
- Ghsa published
- 2026-11-10T21:16:22Z
- Source url
- https://github.com/advisories/GHSA-6cv4-p8m7-4r25
- Ghsa updated
- 2026-11-10T21:16:23Z
- Ghsa id
- GHSA-6cv4-p8m7-4r25
- Last source
- GitHub Advisory Database
- Score
- 5.9
- Cvss version
- 3.1
- Cve id
- CVE-2026-125333
- Cvss vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
- First seen by Signal
- 2026-11-10T19:28:56+00:00
- Is ghsa only
- false
- Vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
- Published at
- 2026-11-10T19:21:10.943
- Last modified
- 2026-11-10T21:46:40.673
Related Entities (3)
AFFECTS (1)
HAS_WEAKNESS (1)
VULNERABLE_TO (1)
Related research
Explore deeper with Ninja Signal's threat intelligence graph