Описание
fs_read_glyphs() in the libXfont2 font-server client (src/fc/fserve.c) copies each glyph's bitmap into a single buffer. Existing checks validates only that the source slice (position, length) lies within the source bitmap buffer. It does not check whether the running destination cursor has exceeded the allocation.
A malicious font server can send overlapping source offsets -- for example 1000 glyphs each referencing {position:0, length:64} with nbytes=64. Each individual source range passes the existing validation, but the cumulative writes total 64000 bytes into a 64-byte destination buffer. This is a heap buffer overflow with attacker-controlled content.
A flaw was found in the libXfont2 font-server client. This heap buffer overflow vulnerability allows a malicious font server to send specially crafted glyph data. The fs_read_glyphs() function fails to properly validate the total size of the incoming data, leading to an overwrite of memory beyond the intended buffer. If the X server runs as a privileged user, this could result in privilege escalation, allowing an attacker to gain higher access. If the X server runs as an unprivileged user, it could lead to a denial of service, causing the system to crash.
Отчет
This is an Important flaw. A heap buffer overflow in the libXfont2 font server client can be triggered by a malicious font server. If the X server runs as root, this could lead to privilege escalation; otherwise, it results in a denial of service. Red Hat Enterprise Linux typically runs the X server as an unprivileged user, mitigating the privilege escalation risk but still allowing for denial of service.
Меры по смягчению последствий
Avoid connecting the X server to untrusted or remote font servers by restricting font path definitions to local storage.
- Inspect X server configuration files (located in
/etc/X11/xorg.confor/etc/X11/xorg.conf.d/) and remove anyFontPathentries pointing to external or remote font servers (such astcp/<hostname>:<port>). Retain only local directory paths or catalogue references (for example,/usr/share/fontsorcatalogue:/etc/X11/fontpath.d). - Ensure that remote font servers are not added dynamically to running sessions using utilities such as
xset(e.g.,xset +fp tcp/...). Warning: Applying configuration changes to the X server requires restarting the display manager (for example,systemctl restart gdm), which will terminate active graphical user sessions and close running applications.
Дополнительная информация
Статус:
EPSS
7.5 High
CVSS3
Связанные уязвимости
fs_read_glyphs() in the libXfont2 font-server client (src/fc/fserve.c) copies each glyph's bitmap into a single buffer. Existing checks validates only that the source slice (position, length) lies within the source bitmap buffer. It does not check whether the running destination cursor has exceeded the allocation. A malicious font server can send overlapping source offsets -- for example 1000 glyphs each referencing {position:0, length:64} with nbytes=64. Each individual source range passes the existing validation, but the cumulative writes total 64000 bytes into a 64-byte destination buffer. This is a heap buffer overflow with attacker-controlled content.
fs_read_glyphs() in the libXfont2 font-server client (src/fc/fserve.c) copies each glyph's bitmap into a single buffer. Existing checks validates only that the source slice (position, length) lies within the source bitmap buffer. It does not check whether the running destination cursor has exceeded the allocation. A malicious font server can send overlapping source offsets -- for example 1000 glyphs each referencing {position:0, length:64} with nbytes=64. Each individual source range passes the existing validation, but the cumulative writes total 64000 bytes into a 64-byte destination buffer. This is a heap buffer overflow with attacker-controlled content.
fs_read_glyphs() heap buffer overflow via cumulative glyph data overflow in libXfont2
fs_read_glyphs() in the libXfont2 font-server client (src/fc/fserve.c) ...
fs_read_glyphs() in the libXfont2 font-server client (src/fc/fserve.c) copies each glyph's bitmap into a single buffer. Existing checks validates only that the source slice (position, length) lies within the source bitmap buffer. It does not check whether the running destination cursor has exceeded the allocation. A malicious font server can send overlapping source offsets -- for example 1000 glyphs each referencing {position:0, length:64} with nbytes=64. Each individual source range passes the existing validation, but the cumulative writes total 64000 bytes into a 64-byte destination buffer. This is a heap buffer overflow with attacker-controlled content.
EPSS
7.5 High
CVSS3