Cyber Security News

PoC Released for Linux Kernel ksmbd Filesystem Vulnerability

Security researcher Norbert Szetei published the final installment of his deep-dive into the ksmbd filesystem module, culminating in a working proof-of-concept exploit targeting CVE-2025-37947.

Unlike earlier use-after-free candidates that required complex race conditions or depended on external factors, this vulnerability offers a deterministic out-of-bounds (OOB) write primitive.

Szetei’s PoC was tested on Ubuntu 22.04.5 LTS running kernel 5.15.0-153-generic, demonstrating a reliable path to local root by carefully overflowing a zero-initialized buffer allocated via kvmalloc().

Root Cause and Exploitation

The flaw resides in the ksmbd_vfs_stream_write() function in fs/ksmbd/vfs.c.

When a writable share is configured with vfs objects = streams_xattr, the code caps the total size at XATTR_SIZE_MAX (0x10000) but still allows a write beyond that limit by setting *pos to 0x10000 and count to 8.

The subsequent memcpy(&stream_buf[*pos], buf, count) writes eight bytes past the buffer boundary, granting an attacker controlled memory corruption.

Heap shaping through SLUB allocator manipulation ensures that the overflow lands adjacent to a target order-4 slab object in Szetei’s case, primary msg_msg kernel messages enabling pointer corruption.

The exploit spray, free, and reclaim steps lead to a use-after-free chain, followed by kernel memory leaks for SMAP, SMEP, and KASLR bypasses, culminating in a stack pivot and ROP chain execution.

The complete exploit flow and source code are available on GitHub.

CVEDescriptionAffected Kernel VersionsCVSS 3.1 ScoreExploit Prerequisites
CVE-2025-37947OOB write in ksmbd_vfs_stream_write() when streams_xattr is enabled, leading to local privilege escalationLinux 5.15.0 through 6.x (pre-patch)7.8Authenticated SMB user; writable share with streams_xattr enabled

CVE-2025-37947 poses a significant threat in environments where SMB file shares rely on ksmbd with extended attribute streams enabled.

Because it requires only valid credentials and minimal share configuration, attackers with standard user accounts can achieve root privileges, undermining host integrity.

Organizations running affected kernels should immediately apply upstream patches or distribution updates.

As a temporary mitigation, disabling the stream_xattr module or removing write permissions from SMB shares prevents trigger conditions.

Monitoring for unusual SMB activity and inspecting /var/log/kern.log for OOB write traces can help detect attempted exploitation.

Finally, enforcing least-privilege SMB account policies and isolating critical systems from untrusted networks further reduces risk until full remediation is confirmed.

Follow us on Google News, LinkedIn, and X to Get Instant Updates and Set GBH as a Preferred Source in Google.

Divya

Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Recent Posts

Hackers Use ConnectWise SkyKick Credentials to Access Microsoft 365, Halting Cloud Backups

Attackers abused compromised ConnectWise Cloud Backup credentials to access Microsoft 365 customer environments, prompting ConnectWise…

1 day ago

Anthropic’s Claude AI Uncovers Origins of NSA-Provided Cryptographic Keys After 25 Years

Anthropic says an internal Claude research model reconstructed how the National Security Agency generated seeds…

1 day ago

Critical WordPress Flaws Allow Attackers to Execute Remote Code Without Authentication

Two WordPress Core vulnerabilities can be chained to execute remote code without authentication, according to…

1 day ago

OpenBSD Kernel Flaw Dating Back 37 Years Enables Local Privilege Escalation to Root

A newly disclosed OpenBSD kernel exploitation chain combines a shared memory accounting flaw with a…

1 day ago

GhostAction Hackers Hide Credential-Stealing Malware in Fake Font Files Across 94 GitHub Repositories

GhostAction attackers have expanded their GitHub credential theft campaign with a second stage that disguises…

1 day ago

SideCopy Hackers Target Indian Organizations With ReverseRAT Malware to Steal Data

Indian authorities have warned that SideCopy hackers are targeting Indian organizations, including academic institutions, with…

1 day ago