Bug 2545908 (CVE-2026-93520) - CVE-2026-93520 xorg-x11-server: xorg-x11-server: arbitrary code execution via out-of-bounds write in XKB keycode handling
Summary: CVE-2026-93520 xorg-x11-server: xorg-x11-server: arbitrary code execution via...
Keywords:
Status: NEW
Alias: CVE-2026-93520
Deadline: 2026-10-07
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-10-05 13:02 UTC by OSIDB Bzimport
Modified: 2026-11-24 04:46 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2026:100477 0 None None None 2026-11-19 18:44:41 UTC
Red Hat Product Errata RHSA-2026:100492 0 None None None 2026-11-19 18:39:47 UTC
Red Hat Product Errata RHSA-2026:100499 0 None None None 2026-11-19 18:39:09 UTC
Red Hat Product Errata RHSA-2026:100648 0 None None None 2026-11-19 23:27:42 UTC
Red Hat Product Errata RHSA-2026:100651 0 None None None 2026-11-19 23:28:37 UTC
Red Hat Product Errata RHSA-2026:102400 0 None None None 2026-11-23 14:54:17 UTC
Red Hat Product Errata RHSA-2026:102402 0 None None None 2026-11-23 14:59:32 UTC
Red Hat Product Errata RHSA-2026:102407 0 None None None 2026-11-23 15:09:02 UTC
Red Hat Product Errata RHSA-2026:102805 0 None None None 2026-11-24 04:46:58 UTC
Red Hat Product Errata RHSA-2026:84574 0 None None None 2026-10-19 04:00:05 UTC
Red Hat Product Errata RHSA-2026:85191 0 None None None 2026-10-19 14:14:35 UTC
Red Hat Product Errata RHSA-2026:85193 0 None None None 2026-10-19 14:40:46 UTC
Red Hat Product Errata RHSA-2026:86907 0 None None None 2026-10-21 12:24:52 UTC
Red Hat Product Errata RHSA-2026:89747 0 None None None 2026-10-26 03:54:04 UTC
Red Hat Product Errata RHSA-2026:95281 0 None None None 2026-11-04 18:10:14 UTC
Red Hat Product Errata RHSA-2026:98476 0 None None None 2026-11-11 11:59:01 UTC
Red Hat Product Errata RHSA-2026:98487 0 None None None 2026-11-11 12:01:50 UTC
Red Hat Product Errata RHSA-2026:98538 0 None None None 2026-11-11 12:14:03 UTC
Red Hat Product Errata RHSA-2026:98546 0 None None None 2026-11-11 09:07:28 UTC
Red Hat Product Errata RHSA-2026:98547 0 None None None 2026-11-11 09:17:07 UTC
Red Hat Product Errata RHSA-2026:98548 0 None None None 2026-11-11 09:29:21 UTC
Red Hat Product Errata RHSA-2026:98549 0 None None None 2026-11-11 09:14:39 UTC
Red Hat Product Errata RHSA-2026:98581 0 None None None 2026-11-11 11:24:03 UTC
Red Hat Product Errata RHSA-2026:98658 0 None None None 2026-11-11 10:07:46 UTC
Red Hat Product Errata RHSA-2026:98659 0 None None None 2026-11-11 10:00:50 UTC
Red Hat Product Errata RHSA-2026:98660 0 None None None 2026-11-11 10:13:49 UTC
Red Hat Product Errata RHSA-2026:98951 0 None None None 2026-11-11 13:47:23 UTC
Red Hat Product Errata RHSA-2026:99122 0 None None None 2026-11-12 02:37:59 UTC
Red Hat Product Errata RHSA-2026:99515 0 None None None 2026-11-12 06:33:08 UTC
Red Hat Product Errata RHSA-2026:99611 0 None None None 2026-11-12 15:16:09 UTC
Red Hat Product Errata RHSA-2026:99623 0 None None None 2026-11-12 13:30:30 UTC
Red Hat Product Errata RHSA-2026:99865 0 None None None 2026-11-12 22:32:39 UTC

Description OSIDB Bzimport 2026-10-05 13:02:52 UTC
This is caused by an incomplete fix regression from commit a3171732d.
     XkbAllocNames() still uses max_key_code+1 for the names->keys allocation
     size, while memset in the ChangeKeycodeRange path uses MAP_LENGTH which
     can be larger. This causes a heap out-of-bounds write when the keycode
     range is changed to a value where MAP_LENGTH exceeds max_key_code+1.

     An authenticated X client can trigger this by sending XKB requests that
     change the keycode range.

     The heap out-of-bounds write can lead to arbitrary code execution or denial
     of service.

     Fixed in: xorg-server-21.1.25 and xwayland-24.1.14
     Fix: https://gitlab.freedesktop.org/xorg/xserver/-/commit/TBD
     Found by: Anonymous working with TrendAI Zero Day Initiative.
               (ZDI-CAN-31941)


* Patch
From 58e2874f69ef83323cdd18a4004535e06a8947bb Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer>
Date: Wed, 26 Aug 2026 17:04:03 +1000
Subject: [PATCH xserver] xkb: allocate names->keys to MAP_LENGTH in
 XkbAllocNames

Commit a3171732d ("xkb: Always use MAP_LENGTH keymap size") converted
most XKB allocation functions to use MAP_LENGTH (256) instead of
max_key_code + 1. It also removed the per-array reallocarray() calls in
XkbChangeKeycodeRange(), replacing them with a memset up to MAP_LENGTH.
However, XkbAllocNames() was missed and still allocates names->keys to
max_key_code + 1.

When a keycodes component with max_key_code < 255 is loaded (e.g.
sun(type6) with max_key_code=132) and then a SetMap request extends
maxKeyCode to 255, XkbChangeKeycodeRange() memsets names->keys from
max_key_code to MAP_LENGTH-1, writing past the undersized allocation.

Fix by allocating names->keys to MAP_LENGTH, consistent with all other
keymap arrays after a3171732d.

This vulnerability was discovered by:
  Anonymous working with TrendAI Zero Day Initiative

ZDI-CAN-31941

CVE-2026-93520

Fixes: a3171732da50 ("xkb: Always use MAP_LENGTH keymap size")

Assisted-by: Claude:claude-opus-4-6
#+begin_src diff
---
 xkb/XKBAlloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xkb/XKBAlloc.c b/xkb/XKBAlloc.c
index dced42eebd2c..314a858ddb09 100644
--- a/xkb/XKBAlloc.c
+++ b/xkb/XKBAlloc.c
@@ -143,17 +143,17 @@ XkbAllocNames(XkbDescPtr xkb, unsigned which, int nTotalRG, int nTotalAliases)
             }
         }
     }
     if ((which & XkbKeyNamesMask) && (names->keys == NULL)) {
         if ((!XkbIsLegalKeycode(xkb->min_key_code)) ||
             (!XkbIsLegalKeycode(xkb->max_key_code)) ||
             (xkb->max_key_code < xkb->min_key_code))
             return BadValue;
-        names->keys = calloc((xkb->max_key_code + 1), sizeof(XkbKeyNameRec));
+        names->keys = calloc(MAP_LENGTH, sizeof(XkbKeyNameRec));
         if (names->keys == NULL)
             return BadAlloc;
     }
     if ((which & XkbKeyAliasesMask) && (nTotalAliases > 0)) {
         if (names->key_aliases == NULL) {
             names->key_aliases = calloc(nTotalAliases, sizeof(XkbKeyAliasRec));
         }
         else if (nTotalAliases > names->num_key_aliases) {
-- 
2.55.0
#+end_src

Comment 1 Jon Orris 2026-10-19 04:00:04 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2026:84574 https://access.redhat.com/errata/RHSA-2026:84574

Comment 2 Jon Orris 2026-10-19 14:14:34 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 10

Via RHSA-2026:85191 https://access.redhat.com/errata/RHSA-2026:85191

Comment 3 Jon Orris 2026-10-19 14:40:45 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2026:85193 https://access.redhat.com/errata/RHSA-2026:85193

Comment 4 Jon Orris 2026-10-21 12:24:52 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2026:86907 https://access.redhat.com/errata/RHSA-2026:86907

Comment 5 Jon Orris 2026-10-26 03:54:03 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2026:89747 https://access.redhat.com/errata/RHSA-2026:89747

Comment 6 Jon Orris 2026-10-26 03:54:04 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2026:89747 https://access.redhat.com/errata/RHSA-2026:89747

Comment 7 Jon Orris 2026-11-04 18:10:13 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2026:95281 https://access.redhat.com/errata/RHSA-2026:95281

Comment 8 errata-xmlrpc 2026-11-11 09:07:27 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 10.0 Extended Update Support

Via RHSA-2026:98546 https://access.redhat.com/errata/RHSA-2026:98546

Comment 9 errata-xmlrpc 2026-11-11 09:14:37 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions

Via RHSA-2026:98549 https://access.redhat.com/errata/RHSA-2026:98549

Comment 10 errata-xmlrpc 2026-11-11 09:17:06 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.4 Update Services for SAP Solutions

Via RHSA-2026:98547 https://access.redhat.com/errata/RHSA-2026:98547

Comment 11 errata-xmlrpc 2026-11-11 09:29:20 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.6 Extended Update Support

Via RHSA-2026:98548 https://access.redhat.com/errata/RHSA-2026:98548

Comment 12 errata-xmlrpc 2026-11-11 10:00:49 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions

Via RHSA-2026:98659 https://access.redhat.com/errata/RHSA-2026:98659

Comment 13 errata-xmlrpc 2026-11-11 10:07:45 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.4 Update Services for SAP Solutions

Via RHSA-2026:98658 https://access.redhat.com/errata/RHSA-2026:98658

Comment 14 errata-xmlrpc 2026-11-11 10:13:46 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.6 Extended Update Support

Via RHSA-2026:98660 https://access.redhat.com/errata/RHSA-2026:98660

Comment 15 errata-xmlrpc 2026-11-11 11:24:02 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 10

Via RHSA-2026:98581 https://access.redhat.com/errata/RHSA-2026:98581

Comment 16 errata-xmlrpc 2026-11-11 11:59:00 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2026:98476 https://access.redhat.com/errata/RHSA-2026:98476

Comment 17 errata-xmlrpc 2026-11-11 12:01:49 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2026:98487 https://access.redhat.com/errata/RHSA-2026:98487

Comment 18 errata-xmlrpc 2026-11-11 12:14:02 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2026:98538 https://access.redhat.com/errata/RHSA-2026:98538

Comment 19 errata-xmlrpc 2026-11-11 13:47:22 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support
  Red Hat Enterprise Linux 8.6 Extended Update Support Long-Life Add-On

Via RHSA-2026:98951 https://access.redhat.com/errata/RHSA-2026:98951

Comment 20 errata-xmlrpc 2026-11-12 02:37:58 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.8 Extended Update Support

Via RHSA-2026:99122 https://access.redhat.com/errata/RHSA-2026:99122

Comment 21 errata-xmlrpc 2026-11-12 06:33:07 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.8 Update Services for SAP Solutions
  Red Hat Enterprise Linux 8.8 Telecommunications Update Service

Via RHSA-2026:99515 https://access.redhat.com/errata/RHSA-2026:99515

Comment 22 errata-xmlrpc 2026-11-12 13:30:29 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2026:99623 https://access.redhat.com/errata/RHSA-2026:99623

Comment 23 errata-xmlrpc 2026-11-12 15:16:08 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2026:99611 https://access.redhat.com/errata/RHSA-2026:99611

Comment 24 errata-xmlrpc 2026-11-12 22:32:38 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2026:99865 https://access.redhat.com/errata/RHSA-2026:99865

Comment 25 errata-xmlrpc 2026-11-19 18:39:08 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.8 Update Services for SAP Solutions
  Red Hat Enterprise Linux 8.8 Telecommunications Update Service

Via RHSA-2026:100499 https://access.redhat.com/errata/RHSA-2026:100499

Comment 26 errata-xmlrpc 2026-11-19 18:39:46 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7 Extended Lifecycle Support

Via RHSA-2026:100492 https://access.redhat.com/errata/RHSA-2026:100492

Comment 27 errata-xmlrpc 2026-11-19 18:44:40 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.8 Extended Update Support

Via RHSA-2026:100477 https://access.redhat.com/errata/RHSA-2026:100477

Comment 28 errata-xmlrpc 2026-11-19 23:27:40 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support
  Red Hat Enterprise Linux 8.6 Extended Update Support Long-Life Add-On

Via RHSA-2026:100648 https://access.redhat.com/errata/RHSA-2026:100648

Comment 29 errata-xmlrpc 2026-11-19 23:28:36 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support
  Red Hat Enterprise Linux 8.4 Extended Update Support Long-Life Add-On

Via RHSA-2026:100651 https://access.redhat.com/errata/RHSA-2026:100651

Comment 30 errata-xmlrpc 2026-11-23 14:54:16 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions

Via RHSA-2026:102400 https://access.redhat.com/errata/RHSA-2026:102400

Comment 31 errata-xmlrpc 2026-11-23 14:59:31 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.4 Update Services for SAP Solutions

Via RHSA-2026:102402 https://access.redhat.com/errata/RHSA-2026:102402

Comment 32 errata-xmlrpc 2026-11-23 15:09:01 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.6 Extended Update Support

Via RHSA-2026:102407 https://access.redhat.com/errata/RHSA-2026:102407

Comment 33 errata-xmlrpc 2026-11-24 04:46:57 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support
  Red Hat Enterprise Linux 8.6 Extended Update Support Long-Life Add-On

Via RHSA-2026:102805 https://access.redhat.com/errata/RHSA-2026:102805


Note You need to log in before you can comment on or make changes to this bug.