https://bugzilla.redhat.com/show_bug.cgi?id=2576980
Bug ID: 2576980
Summary: CVE-2026-109908 libfontenc: libfontenc File Parsing
Validation Failure [fedora-all]
Product: Fedora
Version: rawhide
Status: NEW
Whiteboard: {"flaws": ["0077d1aa-526b-4769-84c0-7006c98f75c0"]}
Component: libfontenc
Keywords: Security, SecurityTracking
Severity: high
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
CC: [email protected], [email protected],
[email protected],
[email protected], [email protected],
[email protected]
Target Milestone: ---
Classification: Fedora
Disclaimer: Community trackers are created by Red Hat Product Security team on
a best effort basis. Package maintainers are required to ascertain if the flaw
indeed affects their package, before starting the update process.
libfontenc's .enc encoding-file parser contains a heap out-of-bounds write
in setCode() (src/encparse.c). The destination index is computed as (from
>> 8) * row_size + (from & 0xFF), where row_size is taken straight from the
SIZE line of the encoding file and is never bounded, while the destination
buffer is allocated at a constant cap of 0x10000 entries.
A crafted .enc file makes the index exceed the allocation and writes past
it. The Xorg/Xwayland X server links libfontenc via libXfont2 and parses
.enc files in its own process during font rasterization.
Where the X server runs as root, a local user that places a font file and
an encoding file on a server-read font path can trigger the OOB write,
triggering potential local privilege escalation.
Fixed in: libfontenc-1.1.10
Fixes:
- https://gitlab.freedesktop.org/xorg/lib/libfontenc/-/commit/TBD
Acknowledgements:
Adam Bedard working with TrendAI Zero Day Initiative
* Patch
From 63bd5096e2f4889fc486a282fd5c1dfb93d559b0 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <[email protected]>
Date: Wed, 16 Sep 2026 15:24:17 +1000
Subject: [PATCH libFontenc 1/1] encparse: fix heap out-of-bounds write in
setCode()
setCode() computes a destination index from two attacker-controlled
values taken from the .enc encoding file:
index = (from >> 8) * row_size + (from & 0xFF);
The "from" parameter is <= 0xFFFF (see the check a few lines above), so
from >> 8 can reach 0xFF. row_size comes straight from the SIZE line of
the encoding file.
The destination buffer is allocated with a size capped at 0x10000
entries. At row_size > 256, the index exceeds the allocation, causing a
heap out-of-bounds write.
For example, SIZE 256 258 and mapping 0xff00 -> 0 gives:
index = 255 * 258 + 0 = 65790, allocation = 65536 entries
Additionally, the column bounds check incorrectly tested the global
variable "value1" instead of the function parameter "from". For
CODE_LINE this happens to be the same value, but for CODE_RANGE_LINE
and CODE_UNDEFINE_LINE the loop calls setCode() with different values
of "from" while value1 remains unchanged.
This vulnerability was discovered by:
Adam Bedard working with TrendAI Zero Day Initiative
CVE-2026-109908, ZDI-CAN-31888
Assisted-by: Claude:claude-opus-4-6
#+begin_src diff
---
src/encparse.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git ./src/encparse.c ../src/encparse.c
index 39dbc89862f8..8949fd475b88 100644
--- ./src/encparse.c
+++ ../src/encparse.c
@@ -450,19 +450,21 @@ setCode(unsigned from, unsigned to, unsigned row_size,
unsigned short *newenc;
if (from > 0xFFFF)
return 0; /* success */
if (row_size == 0)
index = from;
else {
- if ((value1 & 0xFF) >= row_size)
+ if ((from & 0xFF) >= row_size)
return 0; /* ignore out of range mappings */
index = (from >> 8) * row_size + (from & 0xFF);
+ if (index > 0xFFFF)
+ return 0; /* ignore mappings that exceed the encoding
size */
}
/* Optimize away useless identity mappings. This is only expected
to be useful with linear encodings. */
if (index == to && (index < *first || index > *last))
return 0;
if (*encsize == 0) {
*encsize = (index < 256) ? 256 : 0x10000;
--
2.56.0
#+end_src
--
You are receiving this mail because:
You are on the CC list for the bug.
https://bugzilla.redhat.com/show_bug.cgi?id=2576980
Report this comment as SPAM:
https://bugzilla.redhat.com/enter_bug.cgi?product=Bugzilla&format=report-spam&short_desc=Report%20of%20Bug%202576980%23c0
--
_______________________________________________
fonts-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives:
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it:
https://forge.fedoraproject.org/infra/tickets/issues/new