CVE-2025-39851 in Linuxinfo

Summary

by MITRE • 09/19/2025

In the Linux kernel, the following vulnerability has been resolved:

vxlan: Fix NPD when refreshing an FDB entry with a nexthop object

VXLAN FDB entries can point to either a remote destination or an FDB nexthop group. The latter is usually used in EVPN deployments where learning is disabled.

However, when learning is enabled, an incoming packet might try to refresh an FDB entry that points to an FDB nexthop group and therefore does not have a remote. Such packets should be dropped, but they are only dropped after dereferencing the non-existent remote, resulting in a NPD [1] which can be reproduced using [2].

Fix by dropping such packets earlier. Remove the misleading comment from first_remote_rcu().

[1]
BUG: kernel NULL pointer dereference, address: 0000000000000000 [...]
CPU: 13 UID: 0 PID: 361 Comm: mausezahn Not tainted 6.17.0-rc1-virtme-g9f6b606b6b37 #1 PREEMPT(voluntary) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.17.0-4.fc41 04/01/2014 RIP: 0010:vxlan_snoop+0x98/0x1e0 [...]
Call Trace: <TASK> vxlan_encap_bypass+0x209/0x240 encap_bypass_if_local+0xb1/0x100 vxlan_xmit_one+0x1375/0x17e0 vxlan_xmit+0x6b4/0x15f0 dev_hard_start_xmit+0x5d/0x1c0 __dev_queue_xmit+0x246/0xfd0 packet_sendmsg+0x113a/0x1850 __sock_sendmsg+0x38/0x70 __sys_sendto+0x126/0x180 __x64_sys_sendto+0x24/0x30 do_syscall_64+0xa4/0x260 entry_SYSCALL_64_after_hwframe+0x4b/0x53

[2]
#!/bin/bash

ip address add 192.0.2.1/32 dev lo ip address add 192.0.2.2/32 dev lo

ip nexthop add id 1 via 192.0.2.3 fdb ip nexthop add id 10 group 1 fdb

ip link add name vx0 up type vxlan id 10010 local 192.0.2.1 dstport 12345 localbypass ip link add name vx1 up type vxlan id 10020 local 192.0.2.2 dstport 54321 learning

bridge fdb add 00:11:22:33:44:55 dev vx0 self static dst 192.0.2.2 port 54321 vni 10020 bridge fdb add 00:aa:bb:cc:dd:ee dev vx1 self static nhid 10

mausezahn vx0 -a 00:aa:bb:cc:dd:ee -b 00:11:22:33:44:55 -c 1 -q

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 12/22/2025

The vulnerability CVE-2025-39851 affects the Linux kernel's VXLAN implementation and specifically targets the handling of Forwarding Database (FDB) entries during packet processing. This issue manifests when an FDB entry points to a nexthop group rather than a direct remote destination, a configuration commonly used in EVPN deployments where learning is disabled. The core flaw occurs in the vxlan_snoop function, which is responsible for managing FDB entries in VXLAN tunnels. When a packet attempts to refresh an FDB entry that references a nexthop group but lacks a valid remote destination, the kernel incorrectly proceeds with dereferencing a NULL pointer, leading to a kernel NULL pointer dereference (NPD) and subsequent system crash.

The technical execution of this vulnerability follows a specific sequence where packets are processed through the VXLAN tunneling mechanism. The vxlan_snoop function is invoked to handle incoming packets, but it fails to properly validate whether the FDB entry being refreshed has a valid remote destination. When learning is enabled, incoming packets may attempt to update FDB entries that reference nexthop groups, which are designed to work in learning-disabled environments. The kernel's failure to check for the existence of a remote destination before attempting to access it results in a NULL pointer dereference at the memory address 0000000000000000. This dereference occurs within the vxlan_snoop function at offset 0x98 in the vxlan_encap_bypass path, as evidenced by the stack trace showing the call sequence through vxlan_xmit_one and dev_hard_start_xmit functions.

The operational impact of this vulnerability extends beyond simple system crashes, as it represents a potential denial of service vector that can be exploited by remote attackers. The vulnerability can be reliably reproduced using the provided test script that sets up specific VXLAN and nexthop configurations, followed by packet injection using mausezahn. This scenario demonstrates how an attacker could trigger the NPD condition by sending carefully crafted packets that attempt to refresh FDB entries in a specific configuration. The vulnerability directly relates to CWE-476, which describes NULL pointer dereference conditions, and aligns with ATT&CK technique T1499.004, which covers network denial of service attacks. The exploitation requires minimal privileges and can be performed remotely, making it particularly concerning for network infrastructure and cloud environments where VXLAN tunnels are commonly deployed.

Mitigation strategies for CVE-2025-39851 involve implementing early validation of FDB entry states before attempting to access remote destinations, as recommended in the kernel patch. The fix modifies the vxlan_snoop function to drop packets that reference nexthop groups without valid remote destinations before the NULL pointer dereference occurs. System administrators should prioritize applying the kernel patch that resolves this issue, particularly in environments running Linux kernel versions affected by the vulnerability. Additionally, network administrators should monitor VXLAN configurations to ensure that learning and nexthop group usage are properly coordinated, avoiding configurations that could lead to this specific error condition. The vulnerability highlights the importance of proper input validation in kernel space operations and demonstrates how seemingly minor logic flaws can result in critical system instability. Organizations should also consider implementing network segmentation and monitoring to detect anomalous VXLAN traffic patterns that might indicate exploitation attempts.

Responsible

Linux

Reservation

04/16/2025

Disclosure

09/19/2025

Moderation

accepted

CPE

ready

EPSS

0.00293

KEV

no

Activities

very low

Sources

Might our Artificial Intelligence support you?

Check our Alexa App!