Skip to main content

Linux Kernel ksmbd CVE-2026-31610

| EUVDEUVD-2026-25503 MEDIUM
Memory Leak (CWE-401)
2026-04-24 Linux GHSA-g5hw-v48q-45pv
5.5
CVSS 3.1 · NVD
Share

Severity by source

NVD PRIMARY
5.5 MEDIUM
AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
vuln.today AI
7.5 HIGH

ksmbd is a network service; description confirms pre-authentication reachability by untrusted clients, so AV:N and PR:N override the published AV:L/PR:L.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE
MEDIUM
qualitative

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

6
Analysis Generated
Jul 24, 2026 - 02:53 vuln.today
CVSS changed
Apr 29, 2026 - 16:52 NVD
5.5 (MEDIUM)
Patch released
Apr 29, 2026 - 16:51 nvd
Patch available
Patch available
Apr 24, 2026 - 16:16 EUVD
EUVD ID Assigned
Apr 24, 2026 - 15:00 euvd
EUVD-2026-25503
CVE Published
Apr 24, 2026 - 14:42 nvd
MEDIUM 5.5

DescriptionNVD

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

ksmbd: fix mechToken leak when SPNEGO decode fails after token alloc

The kernel ASN.1 BER decoder calls action callbacks incrementally as it walks the input. When ksmbd_decode_negTokenInit() reaches the mechToken [2] OCTET STRING element, ksmbd_neg_token_alloc() allocates conn->mechToken immediately via kmemdup_nul(). If a later element in the same blob is malformed, then the decoder will return nonzero after the allocation is already live. This could happen if mechListMIC [3] overrunse the enclosing SEQUENCE.

decode_negotiation_token() then sets conn->use_spnego = false because both the negTokenInit and negTokenTarg grammars failed. The cleanup at the bottom of smb2_sess_setup() is gated on use_spnego:

if (conn->use_spnego && conn->mechToken) { kfree(conn->mechToken); conn->mechToken = NULL; }

so the kfree is skipped, causing the mechToken to never be freed.

This codepath is reachable pre-authentication, so untrusted clients can cause slow memory leaks on a server without even being properly authenticated.

Fix this up by not checking check for use_spnego, as it's not required, so the memory will always be properly freed. At the same time, always free the memory in ksmbd_conn_free() incase some other failure path forgot to free it.

AnalysisAI

Memory leak in the Linux kernel ksmbd SMB server subsystem allows pre-authenticated remote clients to exhaust kernel memory by repeatedly sending malformed SPNEGO/ASN.1 BER blobs. The ksmbd_decode_negTokenInit() function allocates a mechToken buffer mid-parse via kmemdup_nul(), but if a subsequent element in the same blob is malformed (e.g., mechListMIC[3] overrunning its enclosing SEQUENCE), the decoder fails and clears use_spnego, causing the cleanup gate at smb2_sess_setup() to skip kfree() - leaking the allocation. No public exploit code has been identified at time of analysis, and EPSS sits at 0.03% (10th percentile), consistent with a slow-burn DoS rather than an immediately weaponizable condition.

Technical ContextAI

ksmbd is the in-kernel SMB3 server introduced in Linux 5.15, distinct from the userspace Samba daemon. It processes SMB2 SESSION_SETUP requests that carry SPNEGO tokens encoded as ASN.1 BER. The kernel's BER decoder fires action callbacks (including ksmbd_neg_token_alloc) incrementally as it traverses the structure; this means side effects like heap allocations can occur before the decoder determines whether the full structure is valid. CWE-401 (Missing Release of Memory after Effective Lifetime) is the root cause: the allocation lifecycle is not tied to a single exit path. The conn->mechToken pointer is conditionally freed only when conn->use_spnego remains true, but a partial-parse failure clears that flag, breaking the invariant. Affected CPE: cpe:2.3:a:linux:linux:*:*:*:*:*:*:*:* from the initial ksmbd introduction (commit 1da177e4c3f4) through the fix commits.

RemediationAI

The primary fix is upgrading to a patched Linux kernel: 6.12.83, 6.18.24, 6.19.14, or 7.0.1, depending on the stable branch in use. Upstream fix commits are available at https://git.kernel.org/stable/c/6c8c44e6553b9f072f62d9875e567766eb293162 (6.12.x), https://git.kernel.org/stable/c/dd577cb55588ec3fbc66af3621280306601c4192 (6.18.x), https://git.kernel.org/stable/c/dd53414e301beb915fe672dc4c4a51bafb917604 (6.19.x), and https://git.kernel.org/stable/c/269c800a7a7e363459291885b35f7bc72e231ed6 (mainline). Ubuntu users should apply USN-8488-1. As a compensating control prior to patching, disabling or stopping the ksmbd service (rmmod ksmbd or setting 'server min protocol = SMB3_00' and blocking TCP 445 at the host firewall) eliminates the attack surface entirely but also removes SMB3 kernel server functionality. If ksmbd must remain active, restricting access to the SMB port to known trusted IP ranges via iptables/nftables limits exposure to untrusted clients, though it does not close the vulnerability.

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise High Availability Extension 15 SP7 Fixed
SUSE Linux Enterprise High Availability Extension 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP7 Fixed

Share

CVE-2026-31610 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy