svglib denial of service in recursive SVG image references
svglib before 2.5.0 is affected when svg2rlg() converts user-supplied SVGs that use internal image fragment references. Fixed in 2.5.0.
- Exploited
- No known exploitation
- Fix
- Fixed in 2.5.0
- Who is exposed
- Default setups
Summary
The svglib library has a denial-of-service flaw that lets a remote attacker, without logging in, crash it or consume excessive resources by supplying a specially crafted SVG image. The renderer follows image references inside the SVG that point back to themselves or to each other, with no limit on how far it goes.
Written by a model
Original description
svglib before 2.5.0 contains a denial of service vulnerability in SvgRenderer.renderNode() that recursively renders internal <image> href fragment references without expansion limits or cycle detection. Attackers can supply crafted SVGs to svg2rlg() with nested groups referencing each other twice or self-referencing images to cause exponential resource consumption or RecursionError crashes.
Who should check
Teams running svglib (PyPI) before 2.5.0 that convert user-supplied SVG files with svg2rlg() into ReportLab drawings or PDFs
“Any application using svglib ( svg2rlg ) to convert user-supplied SVG files into ReportLab drawings or PDFs is vulnerable”
What to do
Check every install: default setups are affected.
Upgrade to a fixed version: 2.5.0.
Check your systems with an agent
Paste this into a coding or ops agent. It checks your systems read-only and reports a table per asset.
Check whether my systems are affected by CVE-2026-137952 (svglib before 2.5.0 Denial of Service via Recursive Image Fragment References), using the cve.now data below.
Rules: work read-only. Do not run exploit code, proof-of-concept scripts or scanners that send attack payloads, and do not change any configuration, package, image or deployment. Report findings only.
What cve.now has for CVE-2026-137952 (entry last updated 2026-11-27):
Affected:
- PyPI package svglib: fixed in 2.5.0
Fixed versions: 2.5.0.
Conditions (all must be true for the bug to be hit):
- svglib versions before 2.5.0 (advisory lists <= 2.4.0 as affected) (source: https://github.com/deeplook/svglib/security/advisories/GHSA-cmj4-5g24-pp37)
- Attacker supplies a crafted SVG to svg2rlg() that uses internal <image href="#..."> fragment references (source: https://www.vulncheck.com/advisories/svglib-before-2.5.0-denial-of-service-via-recursive-image-fragment-references)
Setup: the bug is reachable in a default setup; no special feature or setting is needed.
Attacker needs: network access, no login, no user action.
CISA KEV: CVE-2026-137952 is not listed as of cve.now's last read.
This KEV status is for CVE-2026-137952 only. If you also check another CVE, look up its own KEV status; never assume it from this one.
How to check:
- Packages (PyPI): find every lockfile in each project and run the stack.check operation of the cve.now MCP server (execute) on each one. Compare the resolved versions, not the ranges a manifest declares, with the affected versions above. Include transitive dependencies.
Verify against the linked advisories before concluding, and cite the date you read each one:
- https://github.com/deeplook/svglib/security/advisories/GHSA-cmj4-5g24-pp37
- https://github.com/deeplook/svglib/commit/be3c218c35845acb5ad88cca6352a85b0eaad00e
- https://github.com/deeplook/svglib/releases/tag/v2.5.0
- https://github.com/deeplook/svglib/blob/f99f799e6ed5841e3a405d0536a0a79ed991331c/src/svglib/svglib.py#L1427-L1440
- https://www.vulncheck.com/advisories/svglib-before-2.5.0-denial-of-service-via-recursive-image-fragment-references
Do not conclude an asset is unaffected unless you checked it and the evidence covers both its version and the conditions above. If you could not check something, mark it unknown and say what is missing.
Report a table with one row per asset and these columns: Asset | Version or build | Status (affected, fixed, not applicable, unknown) | Compensating controls | Exposure (internet-facing, internal, none) | Evidence | Next action.
Entry: https://cve.now/CVE-2026-137952
For follow-up questions, use the cve.now MCP server at https://mcp.cve.now/mcp (no authentication), for example execute with name cve.get and arguments {"id": "CVE-2026-137952"}.Affected versions
cve.now Index
- Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
- Exposure22/25Default setups, reachable over the network without a login
- Reach16/20svglib: 1.4M downloads a week
- Severity8.7/10CVSS 8.7
- No patch0/5No signal
What would change the score
- Would score about 87 if added to CISA KEV
- Would score about 82 if CISA's SSVC rates exploitation active
Impact
- Widely usedsvglib has 1.4m weekly downloads. pypistats.org248 packages depend on svglib. deps.dev
Timeline
- CVE published
- First seen by cve.now
Evidence 7
| Kind | Source |
|---|---|
| Vendor advisory 1Establishes: Affected and fixed versions. | |
| Advisory | GitHub · deeplook/svglib · Advisory GHSA-cmj4-5g24-pp37 |
| CVE record 2Establishes: The identifier and description. | |
| Record | CVE List · CVE-2026-137952 |
| Record | NVD · CVE-2026-137952 |
| Other links 4 | |
| Patch | GitHub · deeplook/svglib · Commit be3c218c |
| Repository | GitHub · deeplook/svglib · Release v2.5.0 |
| Repository | GitHub · deeplook/svglib · src/svglib/svglib.py · L1427-L1440 |
| Link | vulncheck.com · advisories/svglib-before-2.5.0-denial-of-service-via-recursive-image-fragment-references |
Questions about CVE-2026-137952
Is CVE-2026-137952 being exploited?
It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.
Source: cve.now feed data
What does this mean?
A crafted SVG with nested groups that reference each other, or images that reference themselves, can make svglib freeze the CPU, exhaust memory, or crash with an unhandled RecursionError. The result is a denial of service from a small SVG file.
Source: github.com, vulncheck.com
Which versions are affected by CVE-2026-137952?
svglib (PyPI): before 2.5.0.
Source: cve.now feed data
Am I affected, and how do I check?
svglib versions before 2.5.0 are affected, and the advisory lists 2.4.0 and earlier. Applications that use svg2rlg() to turn user-supplied SVG files into ReportLab drawings or PDFs are in scope. To check an installed version, run pip show svglib.
Source: github.com, vulncheck.com
How do I fix CVE-2026-137952?
Upgrade svglib to 2.5.0 or later, which is the fixed version.
Source: github.com, vulncheck.com
Related
- CVE-2020-10799The svglib package through 0.9.3 for Python allows XXE attacks via an svg2rlg call.
- CVE-2026-132275svglib: Exponential resource consumption via nested <use> references in svg2rlg
- CVE-2026-133761CsvEncoder Nests Rows Once per Key Separator of a Header, Letting a Small CSV Payload Crash PHP
- CVE-2026-135173PdfPig through 0.1.16 Uncontrolled Recursion via AcroForm Field Kids and Marked Content
- CVE-2026-95533In Eclipse Jetty, the JSON parsing utilities provided by artifact `jetty-util-ajax` are vulnerable to `StackOverflowError` for inputs that…
- CVE-2026-136515Memory corruption and crashes when the driver rewrites statements for cursors and escapes
No corrections so far. Something wrong on this page? Report an error.