Skip to content

Commit

Permalink
subset: parse OT-SVG with resolve_entities=False
Browse files Browse the repository at this point in the history
to guard against XXE attacks as recommended in https://codeql.github.com/codeql-query-help/python/py-xxe/
  • Loading branch information
anthrotype committed Sep 15, 2023
1 parent 74240af commit 9f61271
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Lib/fontTools/subset/svg.py
Expand Up @@ -225,6 +225,9 @@ def subset_glyphs(self, s) -> bool:
# ignore blank text as it's not meaningful in OT-SVG; it also prevents
# dangling tail text after removing an element when pretty_print=True
remove_blank_text=True,
# don't replace entities; we don't expect any in OT-SVG and they may
# aboused for XXE attacks
resolve_entities=False,
),
)

Expand Down

0 comments on commit 9f61271

Please sign in to comment.