How CVE-2025-22038 Works
The vulnerability exists in the ksmbd (SMB server) component of the Linux kernel. When processing SMB requests, the kernel fails to validate the `num_subauth` field in a security identifier (PSID). If an attacker sends a malicious SMB packet with num_subauth = 0
, the kernel attempts to access sub_auth[psid->num_subauth - 1]
, leading to an out-of-bounds read. This can cause kernel crashes (DoS) or potentially information disclosure under certain conditions. The flaw arises due to missing validation before accessing the `sub_auth` array.
DailyCVE Form
Platform: Linux Kernel
Version: Pre-patch versions (specific TBD)
Vulnerability: Out-of-Bounds Read
Severity: Critical
Date: 04/16/2025
What Undercode Say:
Exploitation Analysis
- Triggered via crafted SMB request with
num_subauth = 0
. - Exploitable remotely if ksmbd is exposed (default: disabled).
- Potential for KASLR bypass via memory leak.
Detection & Mitigation
Check ksmbd module status lsmod | grep ksmbd Disable ksmbd (mitigation) sudo modprobe -r ksmbd Patch check (upstream fix) git grep "validate num_subauth" /usr/src/linux/
Proof-of-Concept (Crash Trigger)
struct malicious_psid { uint8_t num_subauth = 0; uint32_t sub_auth[bash]; }; send_smb_request(&malicious_psid);
Protection Commands
Block SMB ports (445/tcp, 139/tcp) sudo iptables -A INPUT -p tcp --dport 445,139 -j DROP Kernel update command (post-patch) sudo apt update && sudo apt upgrade linux-image-$(uname -r)
Debugging
Monitor kernel logs for OOB access dmesg | grep "ksmbd" Crash analysis (if triggered) crash /proc/vmcore /usr/lib/debug/boot/vmlinux
Affected Configurations
- Systems with `ksmbd` module loaded (common in NAS setups).
- Kernels v5.15–6.8 (pre-patch).
References
- Kernel commit: `https://git.kernel.org/…/ksmbd-fix-num_subauth-validation`
– CVE Details: `https://nvd.nist.gov/vuln/detail/CVE-2025-22038`
Sources:
Reported By: nvd.nist.gov
Extra Source Hub:
Undercode