{"id":7541,"date":"2025-10-09T10:03:50","date_gmt":"2025-10-09T10:03:50","guid":{"rendered":"https:\/\/serisec.com\/index.php\/2025\/10\/09\/linux-kernel-ksmbd-filesystem-vulnerability-exploited-poc-released\/"},"modified":"2025-10-09T10:03:50","modified_gmt":"2025-10-09T10:03:50","slug":"linux-kernel-ksmbd-filesystem-vulnerability-exploited-poc-released","status":"publish","type":"post","link":"https:\/\/serisec.com\/index.php\/2025\/10\/09\/linux-kernel-ksmbd-filesystem-vulnerability-exploited-poc-released\/","title":{"rendered":"Linux Kernel ksmbd Filesystem Vulnerability Exploited \u2013 PoC Released"},"content":{"rendered":"<p>    Linux Kernel ksmbd Filesystem Vulnerability Exploited \u2013 PoC Released<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p>Security researchers have released a full proof-of-concept (PoC) exploit for a high-severity vulnerability in the Linux kernel\u2019s <code>ksmbd<\/code> module, demonstrating a reliable path to local privilege escalation. <\/p>\n<p>The vulnerability, tracked as CVE-2025-37947, is an <a href=\"https:\/\/cybersecuritynews.com\/out-of-bounds-read-and-write\/\" target=\"_blank\" rel=\"noreferrer noopener\">out-of-bounds write<\/a> that can be leveraged by an authenticated local attacker to gain complete root control over a vulnerable system.<\/p>\n<p>This discovery, detailed by researchers at Doyensec, is the culmination of extensive vulnerability research into the kernel-level Server Message Block (SMB) server, which has seen increased adoption in recent Linux versions. <\/p>\n<p>The public release of the exploit code underscores the practical risk posed by this flaw to systems running the affected kernel module.<\/p>\n<p>The root cause of <a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2025-37947\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">CVE-2025-37947<\/a> lies within the <code>ksmbd_vfs_stream_write()<\/code> function, which is responsible for handling write operations to file streams using extended attributes.<\/p>\n<p>The vulnerability can be triggered by an authenticated user on systems where <code>ksmbd<\/code> is configured with a writable share and the <code>streams_xattr<\/code> VFS module is enabled. <\/p>\n<p>The flaw stems from improper size validation when a user-supplied position and data count surpass the <code>XATTR_SIZE_MAX<\/code> limit of 65,536 bytes. <\/p>\n<p>Although the code truncates the allocation size for the buffer, it fails to adjust the count for the <code>memcpy<\/code> operation accordingly. <\/p>\n<p>This logic error allows an attacker to write a controlled amount of data past the boundary of the allocated kernel buffer, leading to memory corruption in an adjacent memory region.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-from-bug-to-root-privilege-escalation\"><strong>From Bug To Root Privilege Escalation<\/strong><\/h2>\n<p>The Doyensec researchers <a href=\"http:\/\/blog.doyensec.com\/2025\/10\/08\/ksmbd-3.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">detailed<\/a> how this out-of-bounds write primitive can be escalated into a full root exploit on a modern Linux system, specifically Ubuntu 22.04.5 LTS.<\/p>\n<p>The exploitation strategy involves a sophisticated, multi-stage process that begins with heap shaping to manipulate the kernel\u2019s memory layout. <\/p>\n<p>By carefully allocating and freeing kernel objects, the attackers could position a controlled victim object, a <code>msg_msg<\/code> kernel message structure, directly after the vulnerable buffer. <\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgzjjJPLdBVhaJWQfRZ-aJ5SW7wZQzQ8gCzqAmZI7YgAlxTj0Uy3ALzYCT-JyCpyscoruzlkZlaSNXTdzUP0AMw3sgHWX1zJ0Z44q66wARNg1YXy6Yl9Cjoy-9kuHBy4F1fhH6PxOgCFQGUBG2MM3HlK6a7hANhoBIcaata5B1R7aqPsDSRYHrw6gxYgibj\/s1600\/GitLab%2520Security%2520Upda..._imresizer%282%29.webp?ssl=1\" alt=\"\" style=\"width:628px;height:auto\"><\/figure>\n<\/div>\n<p>The out-of-bounds write is then used to corrupt the <code>msg_msg<\/code> header, creating a <a href=\"https:\/\/cybersecuritynews.com\/use-after-free-vulnerability\/\" target=\"_blank\" rel=\"noreferrer noopener\">use-after-free (UAF)<\/a> condition.<\/p>\n<p>This UAF primitive is subsequently used to leak kernel memory addresses, bypassing Kernel Address Space Layout Randomization (KASLR). <\/p>\n<p>With KASLR defeated, the attackers reuse the UAF to overwrite a function pointer in a <code>pipe_buffer<\/code> object, hijacking the kernel\u2019s control flow to execute a ROP chain that grants them root privileges.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-proof-of-concept-exploit-released\"><strong>Proof-of-Concept Exploit Released<\/strong><\/h2>\n<p>In their disclosure, the researchers published the complete local privilege escalation exploit on <a href=\"https:\/\/github.com\/doyensec\/KSMBD-CVE-2025-37947\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">GitHub<\/a>. This allows other security professionals to analyze the attack and validate its impact on their systems.<\/p>\n<p>While the current exploit focuses on local access, the researchers noted that remote exploitation is significantly more challenging, as it would likely require a separate information disclosure vulnerability to defeat <a href=\"https:\/\/cybersecuritynews.com\/kaslr-exploited-apple-silicon\/\" target=\"_blank\" rel=\"noreferrer noopener\">KASLR<\/a> and make heap grooming reliable.<\/p>\n<p>This finding is part of a broader security audit of <code>ksmbd<\/code> by Doyensec, which has previously uncovered other critical vulnerabilities, including several unauthenticated race conditions and memory exhaustion flaws. <\/p>\n<p>System administrators are advised to review their use of <code>ksmbd<\/code> and ensure that their systems are patched against CVE-2025-37947 as updates become available from their Linux distribution providers.<\/p>\n<p class=\"has-text-align-center has-background\" style=\"background:linear-gradient(135deg,rgb(238,238,238) 100%,rgb(169,184,195) 100%)\"><strong><code>Cyber Awareness Month Offer: Upskill With 100+ Premium Cybersecurity Courses From EHA's Diamond Membership: <a href=\"https:\/\/ethicalhacksacademy.com\/pages\/diamond-membership\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Join Today<\/a><\/code><\/strong><\/p>\n<p>The post <a href=\"https:\/\/cybersecuritynews.com\/linux-kernel-ksmbd-vulnerability-exploited\/\">Linux Kernel ksmbd Filesystem Vulnerability Exploited \u2013 PoC Released<\/a> appeared first on <a href=\"https:\/\/cybersecuritynews.com\/\">Cyber Security News<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Guru Baran<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/cybersecuritynews.com\/linux-kernel-ksmbd-vulnerability-exploited\/\">Go to cyber-security-news<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux Kernel ksmbd Filesystem Vulnerability Exploited \u2013 PoC Released Security researchers have released a full proof-of-concept (PoC) exploit for a high-severity vulnerability in the Linux kernel\u2019s ksmbd module, demonstrating a reliable path to local privilege escalation. The vulnerability, tracked as CVE-2025-37947, is an out-of-bounds write that can be leveraged by an authenticated local attacker to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129,63,406,131],"tags":[130],"class_list":["post-7541","post","type-post","status-publish","format-standard","hentry","category-cyber-security","category-cyber-security-news","category-linux","category-vulnerability","tag-cyber-security-news"],"_links":{"self":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/7541"}],"collection":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/comments?post=7541"}],"version-history":[{"count":0,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/7541\/revisions"}],"wp:attachment":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/media?parent=7541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/categories?post=7541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/tags?post=7541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}