# CVE-2026-50259: X.Org X server stack buffer overflow in XKB SetMap request

Source: https://junglewise.ai/threats/cve-2026-50259-x-org-x-server-stack-buffer-overflow-in-xkb-setmap-request  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-05. Updated: 2026-06-05  
License: CC BY 4.0 with a link back

CVE-2026-50259 · Severity: high · CVSS 7.8 · Published 2026-06-05

A security vulnerability has been identified in the X.Org X server and Xwayland, components responsible for managing graphical displays on Linux and Unix-like systems. An attacker with local access to a system can exploit this flaw to crash the display server or potentially gain administrative (root) privileges. This could lead to a full system takeover or a denial of service for all users on the affected machine.

Technologies: [X.Org Foundation X Server](https://junglewise.ai/threats/technologies/x-server), [X.Org Foundation Xwayland](https://junglewise.ai/threats/technologies/xwayland). Vendors: [X.Org Foundation](https://junglewise.ai/threats/vendors/x-org-foundation).

## Quick answers

**Is CVE-2026-50259 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-50259 being exploited in the wild.

**How severe is CVE-2026-50259?** High severity, with a CVSS score of 7.8, published 5 June 2026.

**Which products and versions are affected?** X.Org Foundation X Server <= 21.1.22; X.Org Foundation Xwayland <= 24.1.9.

**Is there a fix for CVE-2026-50259?** A patch was published on 2026-04-20: Upstream fix committed to GitLab Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-50259 attacked?** It is attacked with local access, in an operating system.

**Am I affected by CVE-2026-50259?** Check whether you run X.Org Foundation X Server or X.Org Foundation Xwayland at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A stack-based buffer overflow exists in the _XkbSetMapChecks() function within the X.Org X server and Xwayland. The function declares a fixed-size stack buffer, mapWidths[256], which is indexed by a key type index. A helper function, CheckKeyTypes(), fails to properly validate or clamp the 'nMaps' value (derived from client-controlled 'firstType' and 'nTypes' fields) when the XkbSetMapResizeTypes flag is set. By sending specifically crafted SetMap requests, a local attacker can bypass index checks and write past the buffer boundaries into adjacent stack variables. This can result in a server crash or arbitrary code execution with the privileges of the X server (often root). The issue is fixed in xorg-server 21.1.23 and xwayland 24.1.12.

## Affected products

- X.Org X server <= 21.1.22
- X.Org Xwayland <= 24.1.9

## Timeline

- 2026-04-20: patched: Upstream fix committed to GitLab
- 2026-06-02: advisory: X.Org Security Advisory released
- 2026-06-05: disclosed: CVE published and NVD record created

## References

- [https://access.redhat.com/security/cve/CVE-2026-50259](https://access.redhat.com/security/cve/CVE-2026-50259)
- [https://bugzilla.redhat.com/show_bug.cgi?id=2485384](https://bugzilla.redhat.com/show_bug.cgi?id=2485384)
- [https://gitlab.freedesktop.org/xorg/xserver/-/commit/867b59b33bee669cb412f1314e47c52eacf6e00b](https://gitlab.freedesktop.org/xorg/xserver/-/commit/867b59b33bee669cb412f1314e47c52eacf6e00b)
- [https://lists.x.org/archives/xorg-announce/2026-June/003702.html](https://lists.x.org/archives/xorg-announce/2026-June/003702.html)
- [https://redhat.atlassian.net/browse/PSIRTSUPT-16950](https://redhat.atlassian.net/browse/PSIRTSUPT-16950)

## Related threats

- [X.Org X Server double free in XKB SetGeometry](https://junglewise.ai/threats/cve-2026-88812-a-double-free-in-xkb-setgeometryin-x-org-x-server-before-21-1-25)
- [X.Org X server use-after-free in SyncChangeCounter](https://junglewise.ai/threats/cve-2026-50261-x-org-x-server-use-after-free-in-syncchangecounter)
- [X.Org X server and Xwayland use-after-free in FreeCounter](https://junglewise.ai/threats/cve-2026-50260-x-org-x-server-and-xwayland-use-after-free-in-freecounter)
- [X.Org X server out-of-bounds memory access in XKB request validation](https://junglewise.ai/threats/cve-2026-34003-x-org-x-server-out-of-bounds-memory-access-in-xkb-request)
- [X.Org X server use-after-free in miSyncTriggerFence](https://junglewise.ai/threats/cve-2026-34001-x-org-x-server-use-after-free-in-misynctriggerfence)
