Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-26951 Overview
CVE-2024-26951 is a use-after-free vulnerability [CWE-416] in the Linux kernel's WireGuard netlink interface. The flaw resides in the wg_get_device_dump() code path, where a resumed netlink dump can reference peer structures that were already freed by wg_peer_remove_all(). Instead of checking the proper peer->is_dead flag, the original code relied on peer list emptiness, which fails because removed peers are temporarily chained to a stack-allocated list head. A local attacker able to issue WireGuard netlink operations can trigger kernel memory corruption, leading to privilege escalation, denial of service, or information disclosure.
Critical Impact
Local attackers can trigger a slab-use-after-free in the kernel through concurrent WireGuard configuration operations, enabling potential privilege escalation and host compromise.
Affected Products
- Linux Kernel (multiple stable branches prior to the fixing commits)
- Debian Linux 10.0 (addressed via Debian LTS update)
- Siemens industrial products embedding affected kernels (see Siemens SSA-265688)
Discovery Timeline
- 2024-05-01 - CVE-2024-26951 published to the National Vulnerability Database (NVD)
- 2024-06 - Debian LTS security update released
- 2026-10-15 - Last updated in NVD database
Technical Details for CVE-2024-26951
Vulnerability Analysis
The defect lives in the WireGuard netlink dump handler used to report device and peer configuration to userspace. When wg_peer_remove_all() tears down all peers, it does not clear the device peer_list. Instead, it splices removed peers onto a temporary list whose head resides on the stack of the calling function. The peers remain reachable through that stack-anchored head until the function returns and the stack frame is reused.
If a concurrent wg showconf operation performs a multi-part netlink dump, the dump cursor may point at one of these transiently-linked peers. When the dump resumes, get_peer() iterates from the cursored peer, then follows list pointers into freed memory. The reproducer in the kernel changelog triggers KASAN with a slab-use-after-free in __lock_acquire+0x182a/0x1b20 on the peer->handshake.lock read inside down_read().
Root Cause
The root cause is an incorrect liveness check. The dump code assumed that an empty peer_list was sufficient to detect that peers had been removed. That assumption breaks because wg_peer_remove_all() leaves removed peers connected via a stack-based temporary list rather than clearing them from the device list. The fix replaces the empty-list check with an explicit peer->is_dead test and relocates the device_update_lock lockdep assertion earlier, since reading is_dead requires that lock.
Attack Vector
Exploitation requires local access and the ability to perform WireGuard netlink operations, which typically means CAP_NET_ADMIN within the relevant network namespace. An attacker runs concurrent wg setconf and wg showconf operations against a WireGuard device, racing peer teardown against an in-progress netlink dump. Successful races yield reads and potential writes into freed slab memory, which attackers can shape into kernel information leaks or control-flow hijack primitives.
No public proof-of-concept exploit beyond the reproducer embedded in the kernel commit is listed in the available data. See the fixing commits for technical details: Linux Kernel Commit a104042e and related backports.
Detection Methods for CVE-2024-26951
Indicators of Compromise
- Kernel log entries containing KASAN: slab-use-after-free referencing __lock_acquire, get_peer, or wg_get_device_dump
- Unexpected kernel oops or soft lockups originating from the wireguard module during peer reconfiguration
- Unprivileged processes acquiring elevated capabilities shortly after heavy WireGuard netlink activity
Detection Strategies
- Audit kernel versions across the fleet and flag hosts running WireGuard on pre-patch kernel builds listed in the vendor advisories
- Monitor for processes repeatedly invoking wg setconf and wg showconf in tight loops against the same interface, a pattern consistent with the published reproducer
- Correlate kernel crash telemetry with WireGuard netlink activity using endpoint and SIEM data sources
Monitoring Recommendations
- Forward dmesg and /var/log/kern.log into a central log platform and alert on KASAN, BUG:, and general protection fault strings tied to the wireguard module
- Track invocations of the wg userspace tool and other netlink clients targeting WireGuard interfaces for anomaly baselining
- Review namespace-scoped CAP_NET_ADMIN assignments to identify unprivileged workloads that could reach the vulnerable code path
How to Mitigate CVE-2024-26951
Immediate Actions Required
- Inventory all Linux hosts, containers, and appliances using WireGuard and identify kernel versions against the fixing commits
- Apply distribution kernel updates referenced in the vendor advisories, prioritizing multi-tenant and internet-exposed systems
- Restrict CAP_NET_ADMIN and WireGuard netlink access to trusted administrative accounts and workloads
Patch Information
The upstream fix replaces the empty-list check in wg_get_device_dump() with a peer->is_dead test and moves the device_update_lock lockdep assertion earlier. Backports are available in the stable trees referenced in the Linux kernel commit logs, including commits 13d10779, 302b2dfc, 55b6c738, 710a177f, 7bedfe4c, b7cea3a9, and f52be46e. Debian users should apply the update described in the Debian LTS Announcement June 2024. Siemens customers should consult the Siemens Product Security Advisory SSA-265688 for product-specific guidance.
Workarounds
- Where patching is delayed, unload the wireguard kernel module on systems that do not require it: modprobe -r wireguard
- Limit WireGuard administrative access by removing CAP_NET_ADMIN from untrusted users and container workloads
- Avoid running concurrent wg setconf and wg showconf operations against the same device until patched kernels are deployed
# Verify kernel version and confirm WireGuard module status
uname -r
modinfo wireguard | grep -E '^(version|filename):'
# Temporary mitigation: unload module where WireGuard is not required
sudo modprobe -r wireguard
echo 'blacklist wireguard' | sudo tee /etc/modprobe.d/disable-wireguard.conf
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

