{"answers":{"affected":"3 open source packages ship an affected version, including cairosvg and CairoSVG. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-21236 in the wild and no public exploit code.","fix":"Upgrade cairosvg to 2.5.1 or later.","what":"CVE-2021-21236 is a medium-severity denial of service vulnerability in Kozea CairoSVG, published on 6 Jan 2021. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2021-21236 and fix it if it is affected.\n\nWhat it is: CVE-2021-21236 is a medium-severity denial of service vulnerability in Kozea CairoSVG, published on 6 Jan 2021. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2021-21236 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- cairosvg (PyPI): affected all versions; fixed in 2.5.1\n- cairosvg (PyPI): affected all versions; fixed in 2.5.1\n- CairoSVG (PyPI): affected all versions; fixed in 2.5.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-21236/ (Markdown: https://insights.sbomify.com/CVE-2021-21236/index.md)","id":"CVE-2021-21236","markdown":"https://insights.sbomify.com/CVE-2021-21236/index.md","name":"CVE-2021-21236","record":{"aliases":["DEBIAN-CVE-2021-21236","GHSA-hq37-853p-g5cf","MGASA-2021-0149","PYSEC-2021-5","UBUNTU-CVE-2021-21236"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"Python SVG converter","requires_auth":"low_privilege","summary":"An attacker can cause a denial of service by providing a malicious SVG file that triggers excessive CPU usage in the CairoSVG library.","user_interaction":"required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"cairosvg","vendor":"courtbouillon"}],"cvss":{"score":5.7,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H","version":"3.1"},"cwes":[{"id":"CWE-400","name":"Uncontrolled Resource Consumption"}],"description":"CairoSVG is a Python (pypi) package. CairoSVG is an SVG converter based on Cairo. In CairoSVG before version 2.5.1, there is a regular expression denial of service (REDoS) vulnerability. When processing SVG files, the python package CairoSVG uses two regular expressions which are vulnerable to Regular Expression Denial of Service (REDoS). If an attacker provides a malicious SVG, it can make cairosvg get stuck processing the file for a very long time. This is fixed in version 2.5.1. See Referenced GitHub advisory for more information.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Regular Expression Denial of Service in CairoSVG","id":"CVE-2021-21236","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"denial_of_service","year":"2021"},"n_packages":3,"n_references":4,"next":{"headline":"Git LFS can execute a Git binary from the current directory on Windows","id":"CVE-2021-21237"},"packages":[{"ecosystem":"PyPI","fixed":["2.5.1"],"introduced":["0"],"last_affected":[],"package":"CairoSVG","purl":null,"source":"GHSA-hq37-853p-g5cf"},{"ecosystem":"PyPI","fixed":["2.5.1"],"introduced":["0"],"last_affected":[],"package":"cairosvg","purl":"pkg:pypi/cairosvg","source":"GHSA-hq37-853p-g5cf"},{"ecosystem":"PyPI","fixed":["2.5.1"],"introduced":["0"],"last_affected":[],"package":"cairosvg","purl":"pkg:pypi/cairosvg","source":"PYSEC-2021-5"}],"prev":{"headline":"Infinite loop in parsing PNG files in","id":"CVE-2021-21235"},"products":["CairoSVG"],"published":"2021-01-06","related":[{"cvss_score":9.9,"headline":"CairoSVG improperly processes SVG files loaded from external resources","id":"CVE-2023-27586","kev_date_added":null,"published":"2023-03-20"},{"cvss_score":7.5,"headline":"CairoSVG vulnerable to Exponential DoS via recursive \u003cuse\u003e element amplification","id":"CVE-2026-31899","kev_date_added":null,"published":"2026-03-13"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-03","vendors":["Kozea"]},"summary":"An attacker can cause a denial of service by providing a malicious SVG file that triggers excessive CPU usage in the CairoSVG library.","url":"https://insights.sbomify.com/CVE-2021-21236/"}