Skip to content
Heist/ feed
Back to feed
Medium

cairosvg — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2021-21236

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.

Products
cairosvg
Affected versions
1.0.16-1, 1.0.17-1, 1.0.19-1, 1.0.20-1, 2.4.0-2, 2.4.2-1, 2.5.0-1.1, 2.5.2-1, 2.7.1-1, 2.7.1-2, 2.8.2-1, 2.9.0-1, 2.9.0-2
Fixed versions
Not specified
CVEs
CVE-2021-21236
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 00:57 UTC · Revision 1

Source evidence

UBUNTU-CVE-2021-21236

core-osv · Original source

Published 6 Jan 2021, 17:15 UTC

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.

osv:UBUNTU-CVE-2021-21236

cairosvg

Fixed versions: Not specified

cairosvg

Fixed versions: Not specified

cairosvg

Fixed versions: Not specified

cairosvg

Fixed versions: Not specified

cairosvg

Fixed versions: Not specified

cairosvg

Fixed versions: Not specified

cairosvg

Fixed versions: Not specified

cairosvg

Fixed versions: Not specified

Complete source record
{
  "id": "2dd019116d46326b41ad295e91ae7a791aa5662b81c6b5eb0682b102584294b0",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2021-21236",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2021-21236",
    "summary": "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.",
    "evidence": "osv:UBUNTU-CVE-2021-21236",
    "products": [
      {
        "name": {
          "value": "cairosvg",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.0.16-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.0.17-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.0.19-1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "cairosvg",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.0.20-1",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "cairosvg",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.4.0-2",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "2.4.2-1",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "cairosvg",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.5.0-1.1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "2.5.2-1",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "cairosvg",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.7.1-1",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "cairosvg",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.7.1-1",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "2.7.1-2",
            "evidence": "/affected/5/versions"
          }
        ]
      },
      {
        "name": {
          "value": "cairosvg",
          "evidence": "/affected/6/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.8.2-1",
            "evidence": "/affected/6/versions"
          },
          {
            "value": "2.9.0-1",
            "evidence": "/affected/6/versions"
          },
          {
            "value": "2.9.0-2",
            "evidence": "/affected/6/versions"
          }
        ]
      },
      {
        "name": {
          "value": "cairosvg",
          "evidence": "/affected/7/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.7.1-2",
            "evidence": "/affected/7/versions"
          },
          {
            "value": "2.8.2-1",
            "evidence": "/affected/7/versions"
          }
        ]
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "UBUNTU-CVE-2021-21236",
      "aliases": [
        "UBUNTU-CVE-2021-21236"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H"
        },
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "cairosvg",
            "purl": "pkg:deb/ubuntu/cairosvg?arch=source&distro=xenial",
            "ecosystem": "Ubuntu:16.04:LTS"
          },
          "versions": [
            "1.0.16-1",
            "1.0.17-1",
            "1.0.19-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-21236.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python-cairosvg",
                "binary_version": "1.0.19-1"
              },
              {
                "binary_name": "python3-cairosvg",
                "binary_version": "1.0.19-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "cairosvg",
            "purl": "pkg:deb/ubuntu/cairosvg?arch=source&distro=bionic",
            "ecosystem": "Ubuntu:18.04:LTS"
          },
          "versions": [
            "1.0.20-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-21236.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "python-cairosvg",
                "binary_version": "1.0.20-1"
              },
              {
                "binary_name": "python3-cairosvg",
                "binary_version": "1.0.20-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "cairosvg",
            "purl": "pkg:deb/ubuntu/cairosvg?arch=source&distro=focal",
            "ecosystem": "Ubuntu:20.04:LTS"
          },
          "versions": [
            "2.4.0-2",
            "2.4.2-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-21236.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "cairosvg",
                "binary_version": "2.4.2-1"
              },
              {
                "binary_name": "python3-cairosvg",
                "binary_version": "2.4.2-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "cairosvg",
            "purl": "pkg:deb/ubuntu/cairosvg?arch=source&distro=jammy",
            "ecosystem": "Ubuntu:22.04:LTS"
          },
          "versions": [
            "2.5.0-1.1",
            "2.5.2-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-21236.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "cairosvg",
                "binary_version": "2.5.2-1"
              },
              {
                "binary_name": "python3-cairosvg",
                "binary_version": "2.5.2-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "cairosvg",
            "purl": "pkg:deb/ubuntu/cairosvg?arch=source&distro=noble",
            "ecosystem": "Ubuntu:24.04:LTS"
          },
          "versions": [
            "2.7.1-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-21236.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "cairosvg",
                "binary_version": "2.7.1-1"
              },
              {
                "binary_name": "python3-cairosvg",
                "binary_version": "2.7.1-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "cairosvg",
            "purl": "pkg:deb/ubuntu/cairosvg?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "2.7.1-1",
            "2.7.1-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-21236.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "cairosvg",
                "binary_version": "2.7.1-2"
              },
              {
                "binary_name": "python3-cairosvg",
                "binary_version": "2.7.1-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "cairosvg",
            "purl": "pkg:deb/ubuntu/cairosvg?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "2.8.2-1",
            "2.9.0-1",
            "2.9.0-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-21236.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "cairosvg",
                "binary_version": "2.9.0-2"
              },
              {
                "binary_name": "python3-cairosvg",
                "binary_version": "2.9.0-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "cairosvg",
            "purl": "pkg:deb/ubuntu/cairosvg?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "2.7.1-2",
            "2.8.2-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-21236.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "cairosvg",
                "binary_version": "2.8.2-1"
              },
              {
                "binary_name": "python3-cairosvg",
                "binary_version": "2.8.2-1"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:56:19.326673305Z",
      "provider": "osv",
      "upstream": [
        "CVE-2021-21236"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2021-21236",
        "https://github.com/Kozea/CairoSVG/security/advisories/GHSA-hq37-853p-g5cf",
        "https://github.com/Kozea/CairoSVG/commit/063185b60588a41d4df661ad70f9f7b699901abc",
        "https://github.com/Kozea/CairoSVG/commit/cfc9175e590531d90384aa88845052de53d94bf3",
        "https://github.com/Kozea/CairoSVG/releases/tag/2.5.1",
        "https://pypi.org/project/CairoSVG/",
        "https://www.cve.org/CVERecord?id=CVE-2021-21236"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2021-21236",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 355246,
  "published_at": "2021-01-06T17:15:00+00:00"
}