Nodeca probe-image-size
probe-image-size: Quadratic-time Denial of Service in the SVG Parser
probe-image-size gets image dimensions without downloading the entire file. Prior to 7.4.0, lib/parse_sync/svg.js and lib/parse_stream/svg.js use the searching regular expression /<[-_.:a-zA-Z0-9][^>]*>/, which repeatedly scans to the end of input when attacker-controlled data contains many less-than characters without a closing greater-than character. The synchronous parser converts and scans the full supplied buffer without an input cap, while the streaming parser reparses the complete accumulated SVG prefix for every received chunk. The probe.sync(), probe(stream), and probe(url) entry points can therefore block the Node.js event loop at full CPU, and attacker-controlled chunking can amplify the streaming cost. This issue is fixed in version 7.4.0.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 7.4.0
Fixed in 7.4.0
Mitigation
Upgrade probe-image-size to 7.4.0 or later.
References
- Vendor advisory github.com/nodeca/probe-image-size/security/ad…
- Patch github.com/nodeca/probe-image-size/commit/60cc…
- Patch github.com/nodeca/probe-image-size/commit/9b74…
2 more
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.