Update dependency fonttools to v4.43.0 [SECURITY] #541
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==4.28.2
->==4.43.0
Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
GitHub Vulnerability Alerts
CVE-2023-45139
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.
/etc/passwd
for our POC file to include and modified an existing subset integration test to build the POC font - see bellow.fonttools==4.42.1
andfonttools==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):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.
Possible Mitigations
There may be other ways to mitigate the issue, but some suggestions:
resolve_entities=False
flag on parsing methodsRelease Notes
fonttools/fonttools (fonttools)
v4.43.0
Compare Source
XMLParser(resolve_entities=False)
when parsing OT-SVG documents to prevent XML External Entity (XXE) attacks (9f61271
): https://codeql.github.com/codeql-query-help/python/py-xxe/iup_delta_optimize
that was leading to IUP tolerance being incorrectly initialised, resulting in sub-optimal deltas (6012643
, cython/cython#5732).fonttools varLib.avar
to add anavar
table to an existing VF from axes mappings in a .designspace file (0a3360e
).v4.42.1
Compare Source
457f11c
).addMultilingualName
andttFont
parameter was not passed on tofindMultilingualName
(#3253).v4.42.0
Compare Source
v4.41.1
Compare Source
NameRecordVisitor
only visit tables that do contain nameID references (#3213, #3214).CursivePos
masters (#3209).v4.41.0
Compare Source
removeUnusedNameRecords
in the user range (#3185)._add_avar()
call site (#3183).voltLib.voltToFea
submodule (originally Tiro Typeworks' "Volto") for converting VOLT OpenType Layout sources to FEA format (#3164).v4.40.0
Compare Source
pip install --no-binary=fonttools fonttools
to expliclity request pip to install from the pure-python source.avar2
table from those (#3123).Added
quantization
option (#3126).v4.39.4
Compare Source
v4.39.3
Compare Source
seekable
method was only added in python 3.11 (https://github.com/fonttools/fonttools/issues/3052).v4.39.2
Compare Source
NOTE: The 4.39.1 distribution was "yanked" from PyPI to prevent users from accidentally upgrading to it.
v4.39.1
Compare Source
https://github.com/harfbuzz/boring-expansion-spec/blob/main/avar2.md
STAT
table that was built with feaLib from FEA feature file. Also, added support for building multiple VFs defined in Designspace v5 fromfonttools varLib
script (https://github.com/fonttools/fonttools/pull/3024).Debg
table with lookup names whenFONTTOOLS_LOOKUP_DEBUGGING
env variable is set (https://github.com/fonttools/fonttools/pull/3023).v4.39.0
Compare Source
Debg
debug info for MTI feature builds (#3018).-
character, similar to existing-o -
option to write output to standard output (#3020).cython.compiled
raise AttributeError if cython not installed properly (#3017).debug
parameter to addOpenTypeFeatures method to add source debugging information to the font in theDebg
private table (#3008).__lt__
comparison not fail on Unicode encoding errors (#3006).overlayBox
(#3003, #3005).https://github.com/harfbuzz/boring-expansion-spec/blob/main/glyf1-cubicOutlines.md
https://github.com/harfbuzz/boring-expansion-spec/blob/main/glyf1-varComposites.md.
addVarComponent
method to pen protocols' base classes, which pens can implement to handle varcomponents (by default they get decomposed).__getstate__
for BaseTable so that a copied/pickled 'lazy' object gets its own OTTableReader to read from; incidentally fixes a bug while subsetting COLRv1 table containing ClipBoxes on python 3.11 (#2965, #2968).endPointsOfContours
field should be unsigned! Kudos to behdad for spotting one of the oldest bugs in FT. Probably nobody has ever dared to make glyphs with more than 32767 points... (#2957).ignore
statements with unmarked glyphs to match makeotf behavior, which assumes the first glyph is marked (#2950).black
and enforce new code style via CI check (#2925).v4.38.0
Compare Source
It's now also possible to restrict an axis min/max values beyond the current default value, e.g. a font wght has min=100, def=400, max=900 and you want a partial VF that only varies between 500 and 700, you can now do that. You can either specify two min/max values (wght=500:700), and the new default will be set to either the minimum or maximum, depending on which one is closer to the current default (e.g. 500 in this case). Or you can specify three values (e.g. wght=500:600:700) to set the new default value explicitly.
Add optional extrapolate=False to normalizeLocation() (#2847, #2849).
v4.37.4
Compare Source
v4.37.3
Compare Source
v4.37.2
Compare Source
--no-lazy
to optionally load fonts eagerly (mostly to ease debugging of table lazy loading, no practical effects) (https://github.com/fonttools/fonttools/pull/2807).VarScalar
by caching models for recurring master locations (https://github.com/fonttools/fonttools/pull/2798).feaLib.lexer
, speeds up parsing FEA a bit (https://github.com/fonttools/fonttools/pull/2799).post
legacy format 1 is malformed/improperly used (https://github.com/fonttools/fonttools/pull/2786)normalizeLocation
method to normalize a location dict from the font's defined axes space (also known as "user space") into the normalized (-1..+1) space. It appliesavar
mapping if the font contains anavar
table (https://github.com/fonttools/fonttools/pull/2789).statShape.py
script to draw statistical shape of a glyph as an ellips (requires pycairo) (fonttools/fonttools@baecd88).v4.37.1
Compare Source
HVAR
andVVAR
tables, whereby anAttributeError: subset_varidxes
was thrown because an apparently unused import statement (with the side-effect of dynamically binding thatsubset_varidxes
method to the VarStore class) had been accidentally deleted in an unrelated PR (#2769, #2773).cairoPen
(#2768).gvar
more lazily by not parsing all of theglyf
table (#2771).drawPoints(pointPen)
method work for CFF fonts as well via adapter pen (#2770).v4.37.0
Compare Source
It will be restored in upcoming release once we found a solution to the bug.
blend
operator (https://github.com/fonttools/fonttools/pull/2750, https://github.com/fonttools/fonttools/issues/1975)._TTVarGlyphSet
inherits from_TTGlyphSet
to keep backward compatibility with existing API (https://github.com/fonttools/fonttools/pull/2762).fontTools.misc.visitor
andfontTools.ttLib.ttVisitor
. AddedfontTools.ttLib.scaleUpem
module that uses the latter to change a font's units-per-em and scale all the related fields accordingly (https://github.com/fonttools/fonttools/pull/2718, https://github.com/fonttools/fonttools/pull/2755).v4.36.0
Compare Source
The simpler algorithm produces fewer overlapping regions and behaves better with respect to rounding at the peak positions than the generic solver, always matching intermediate masters exactly, instead of maximally 0.5 units off. This may be useful when 100% metrics compatibility is desired (#2218, #2717).
GDEF
not being built when explicitly not requested; don't build one unconditonally even when not requested (#2744, also works around #2747).TTFont.getGlyphSet
method now supports selecting a location that represents an instance of a variable font (supports both user-scale and normalized axes coordinates via thenormalized=False
parameter). Currently this only works for TrueType-flavored variable fonts (#2738).v4.35.0
Compare Source
_instantiateFeatureVariations
when at the same time pinning one axis and restricting the range of a subsequent axis; the wrong axis tag was being used in the latter step (as the records' axisIdx was updated in the preceding step but looked up using the old axes order in the following step) (#2733, #2734).'.'
instead of'#'
in duplicate glyph names (#2742).build_many
, we forgot to pass oncolr_layer_reuse
parameter to thebuild
method (#2730).6df779f
).2963fa5
).glyphsLib
).varLib.iup
(35% faster),pens.momentsPen
(makesvarLib.interpolatable
3x faster).AttributeError
when uharfbuzz < 0.23.0 andrepack
method is missing (32aa8ea
).Use new
uharfbuzz.repack_with_tag
when available (since uharfbuzz>=0.30.0), enables table-specific optimizations to be performed during repacking (#2724).4139d89
). Avoid division-by-zero (52b28f9
).NotANone
variable (#2714).v4.34.4
Compare Source
v4.34.3
Compare Source
v4.34.2
Compare Source
a08140d
).v4.34.1
Compare Source
v4.34.0
Compare Source
Base color glyphs of same name in different masters must have identical paint graph structure (incl. number of layers, palette indices, number of color line stops, corresponding paint formats at each level of the graph), but can differ in the variable fields (e.g. PaintSolid.Alpha). PaintVar* tables are produced when this happens and a VarStore/DeltaSetIndexMap is added to the variable COLR table. It is possible for non-default masters to be 'sparse', i.e. omit some of the color glyphs present in the default master.
compressed
field, and no longer a bare 3-tuple (#2645).Updated how table packing falls back to fontTools from harfbuzz (#2668).
v4.33.3
Compare Source
deepcopyExceptFonts
method, preventing font references to be transferred (#2600).Fixed another typo in the name of
Range
dataclass's__post_init__
magic method (#2597).v4.33.2
Compare Source
Do not exit at the first failure but continue attempting to fix offset overflow error using the pure-python serializer even when the
USE_HARFBUZZ_REPACKER
option was explicitly set toTrue
. This is normal with fonts with relatively large tables, at least until hb.repack implements proper table splitting.v4.33.1
Compare Source
FONTTOOLS_GPOS_COMPACT_MODE
environment variable to fix regression in ufo2ft (and thus fontmake) introduced with v4.33.0 (#2592, #2593).This is deprecated and will be removed once ufo2ft gets updated to use the new config setup.
v4.33.0
Compare Source
OS/2.xAvgCharWidth
after merging fonts withfontTools.merge
(#2591, #2538).fontTools.misc.configTools
module, a generic configuration system (#2416, #2349).Added
fontTools.config
module, a fontTools-specific configuration system usingconfigTools
above.Attached a
Config
object toTTFont
.Added discrete axes, variable fonts, STAT information, either design- or user-space location on instances.
Added
fontTools.designspaceLib.split
module to split a designspace into sub-spaces that interpolate and that represent the variable fonts listed in the document.Made instance names optional and allow computing them from STAT data instead.
Added
fontTools.designspaceLib.statNames
module.Allow instances to have the same location as a previously defined STAT label.
Deprecated some attributes:
SourceDescriptor
:copyLib
,copyInfo
,copyGroups
,copyFeatures
.InstanceDescriptor
:kerning
,info
;glyphs
: use rules or sparse sources.For both,
location
: use the more explicit designLocation.Note: all are soft deprecations and existing code should keep working.
Updated documentation for Python methods and the XML format.
build_many
to build several variable fonts from a single designspace document (#2436).Added
fontTools.varLib.stat
module to build STAT tables from a designspace document.uharfbuzz
python bindings are available (#2552). Disable it by setting the "fontTools.ttLib.tables.otBase:USE_HARFBUZZ_REPACKER" config option toFalse
. If the option is set explicitly toTrue
butuharfbuzz
can't be imported or fails to serialize for any reasons, an error will be raised (ImportError or uharfbuzz errors).pen.closePath()
gets called for CFF2 charstrings (#2577).Handle implicit CFF2 closePath within
T2OutlineExtractor
(#2580).v4.32.0
Compare Source
outputImpliedClosingLine=False
parameter toGlyph.draw()
, to control behaviour ofPointToSegmentPen
(6b4e2e7
).GlobalState
class and fix calls toTopDictIndex()
(#2569, #2570).AxisValueArray
if it is empty after instantiating (#2563).v4.31.2
Compare Source
v4.31.1
Compare Source
<svg>
element (#2553).v4.31.0
Compare Source
ensureDecompiled
method to load all tables irrespective of thelazy
attribute (#2551).iterSubTable
method to iterate over BaseTable's children of type BaseTable; useful for traversing a tree of otTables (#2551).v4.30.0
Compare Source
gvar
is built (#2542).FoundANone
andUnsupportedFormat
exceptions (ac4d561
).windowsNames
andmacNames
(bool) parameters to thebuildStatTable
function, so that one can select whether to only add one or both of the two sets (#2528).getFirstDebugName
,getBest{Family,SubFamily,Full}Name
methods (#2526).v4.29.1
Compare Source
v4.29.0
Compare Source
waitForKeyPress
method on Windows (#2509).freetype-py
and the pen protocol for rasterizating outline paths (#2494).Bumped unicodedata2 dependency to 14.0 (#2499).
fontName
insuckfont
(#2496).v4.28.5
Compare Source
str()
are now replaced with user-definedntos
callable.Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.