probe-image-size: Quadratic-time Denial of Service in the SVG Parser
## Overview `probe-image-size` scans the SVG header with a searching regular expression, `/<[-_.:a-zA-Z0-9][^>]*>/`. On input that contains many `<` characters but no `>`, the engine restarts the `[^>]*` scan at every `<` position and runs to end of input each time, giving quadratic time complexity. Both the synchronous and the streaming parser are affected. ## Impact Every entry point that reaches the SVG parser is affected: `probe.sync()`, `probe(stream)` and `probe(url)`. The URL form is the most exposed one — the input is fetched from a remote host, so an attacker only needs to supply a link. Processing a crafted buffer blocks the Node.js event loop at 100% CPU for the whole duration. In production environments such as upload validators, image proxies or link unfurl services, a small number of concurrent requests is enough to deny service. ## Root Cause Analysis Two independent problems. 1. **Absence of input size cap in the sync path.** `lib/parse_sync/svg.js` copied the entire buffer into a string and matched against it. There was no size limit at all, so cost scaled with the size of the attacker-supplied buffer. 2. **Repeated rescanning in the stream path.** `lib/parse_stream/svg.js` did cap accumulated data at 64 KB, but called `parseSvg(str)` on the whole accumulated string on *every* chunk, giving `O(chunks × N²)`. The cap does not help here: the more chunks the input is split into, the more times the quadratic scan is repeated. Chunk size is influenced by the sende
GHSA-gjj5-9665-rwrc
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:GHSA-gjj5-9665-rwrc
probe-image-size
Source reference: /affected/0/package/name
- Affected versions
- Not stated in this record
- Fixed versions
- 7.4.0
Source reference:
/affected/0/ranges - Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0"
},
{
"fixed": "7.4.0"
}
]
}
],
"package": {
"name": "probe-image-size",
"purl": "pkg:npm/probe-image-size",
"ecosystem": "npm"
},
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-gjj5-9665-rwrc/GHSA-gjj5-9665-rwrc.json",
"last_known_affected_version_range": "<= 7.3.0"
}
}
]- Related CVEs
- CVE-2026-104861
Source reference:
/aliases
Publisher severity
high
Source reference: /database_specific/severity
- Event
- #72766 · Revision 1
- Added to Heist Feed
- Publisher date