CVE-2024-26951: wireguard: netlink: check for dangling peer via is_dead instead of empty list
In the Linux kernel, the following vulnerability has been resolved:
wireguard: netlink: check for dangling peer via is_dead instead of empty list
If all peers are removed via wg_peer_remove_all(), rather than setting
peer_list to empty, the peer is added to a temporary list with a head on
the stack of wg_peer_remove_all(). If a netlink dump is resumed and the
cursored peer is one that has been removed via wg_peer_remove_all(), it
will iterate from that peer and then attempt to dump freed peers.
Fix this by instead checking peer->is_dead, which was explictly created
for this purpose. Also move up the device_update_lock lockdep assertion,
since reading is_dead relies on that.
It can be reproduced by a small script like:
echo "Setting config..."
ip link add dev wg0 type wireguard
wg setconf wg0 /big-config
(
while true; do
echo "Showing config..."
wg showconf wg0 > /dev/null
done
) &
sleep 4
wg setconf wg0 <(printf "[Peer]\nPublicKey=$(wg genkey)\n")
Resulting in:
BUG: KASAN: slab-use-after-free in __lock_acquire+0x182a/0x1b20
Read of size 8 at addr ffff88811956ec70 by task wg/59
CPU: 2 PID: 59 Comm: wg Not tainted 6.8.0-rc2-debug+ #5
Call Trace:
<TASK>
dump_stack_lvl+0x47/0x70
print_address_description.constprop.0+0x2c/0x380
print_report+0xab/0x250
kasan_report+0xba/0xf0
__lock_acquire+0x182a/0x1b20
lock_acquire+0x191/0x4b0
down_read+0x80/0x440
get_peer+0x140/0xcb0
wg_get_device_dump+0x471/0x1130
Security readout for executives and security teams
Plain-English summary
A flaw in Linux WireGuard management can make the kernel read already-freed peer data when configuration is displayed while peers are removed. This may crash or corrupt the kernel. The supplied rating assumes a local, low-privilege attacker and potentially severe impact, so affected WireGuard systems warrant prompt updates. The bundle provides no evidence of attacks in the wild.
Executive priority
Treat this as a prompt remediation item for WireGuard-enabled servers, gateways, appliances, and shared Linux environments. It is not supported as an emergency internet-wide threat because the vector is local and active exploitation is unconfirmed. Accelerate patching where untrusted or lower-privileged users can influence WireGuard management operations.
Technical view
A resumed WireGuard netlink dump can retain a cursor to a peer removed by wg_peer_remove_all(). That peer resides on a temporary list whose head was stack-backed; subsequent iteration may access freed peers, producing a slab use-after-free. The kernel fix checks peer->is_dead under the device update lock instead of treating an empty list as the dangling-peer signal.
Likely exposure
Potential exposure is limited to Linux systems running vulnerable kernels where WireGuard peer removal can overlap a resumed netlink configuration dump. The flattened version list does not provide reliable range semantics, so exact affected boundaries cannot be determined from this bundle alone. Map installed kernels to vendor advisories or the referenced stable fixes.
Exploitation context
The bundle marks KEV false and supplies no evidence of active exploitation. It documents reproducibility under KASAN, but does not establish reliable privilege escalation, code execution, or real-world compromise. The supplied CVSS vector characterizes exploitation as local, low-complexity, low-privilege, and requiring no user interaction.
Researcher notes
The demonstrated failure is a slab use-after-free reached through stale netlink dump cursor state after bulk peer removal. KASAN observed the invalid read during locking activity. The sources do not establish exploitability beyond the memory-safety failure. Review branch-specific stable commits because the supplied affected-version representation is insufficient for precise boundary analysis.
Mitigation direction
Apply a vendor-supported kernel update containing the referenced WireGuard fix.
Prioritize systems actively using WireGuard or allowing users to manage its configuration.
If updating is delayed, consult vendor guidance and tightly restrict WireGuard configuration access.
Validation and detection
Inventory kernel versions and identify systems where WireGuard is loaded or configured.
Map each installed vendor kernel to a referenced upstream fix or vendor advisory.
Confirm patched systems can dump WireGuard configuration during authorized peer changes without kernel errors.
Review kernel logs for crashes or use-after-free reports involving WireGuard netlink operations.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2024-26951 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.