Skip to main content

Linux Kernel ksmbd EUVDEUVD-2026-25503

| CVE-2026-31610 MEDIUM
Memory Leak (CWE-401)
2026-04-24 Linux GHSA-g5hw-v48q-45pv
5.5
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Connect to exposed SMB TCP/445 port
  2. Delivery
    Send SESSION_SETUP with malformed SPNEGO blob
  3. Exploit
    mechToken allocated mid-parse by ksmbd_neg_token_alloc
  4. Install
    Subsequent ASN.1 element fails decode
  5. C2
    use_spnego cleared, kfree skipped
  6. Execute
    Repeat requests to accumulate heap leak
  7. Impact
    Kernel memory exhausted, server availability degrades

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Resource cleanup, leak prevention
Exploitation Conditions

ksmbd must be running and its SMB2 port (TCP 445) must be reachable by the attacker - the code path is in smb2_sess_setup(), which processes SESSION_SETUP requests before any credential validation, making authentication a non-requirement. The SPNEGO decode path must be reached, meaning the client's SECURITY_BUFFER must contain a negTokenInit or negTokenTarg envelope with at least a valid mechToken[2] OCTET STRING followed by a malformed element. No special server configuration beyond running ksmbd is required. Limiting factors: the leak is slow and cumulative rather than immediately catastrophic; the server must be under sustained attack or high load for impact to materialize; systems running Samba (smbd) instead of ksmbd are entirely unaffected.

Impact

There is a notable conflict between the NVD-assigned CVSS vector (AV:L/AC:L/PR:L) and the vulnerability description, which explicitly states the codepath is reachable pre-authentication by untrusted network clients - strongly implying AV:N/PR:N is more accurate. At the published CVSS 5.5 (local vector) the risk appears moderate, but if the correct vector is AV:N/PR:N the unadjusted base score rises to approximately 7.5 and the real-world exposure is broader. EPSS at 0.03% (10th percentile) and absence from CISA KEV suggest opportunistic exploitation is not currently occurring. The impact is limited to availability (slow kernel memory exhaustion), with no confidentiality or integrity component despite the 'Information Disclosure' tag in the source data - that tag appears incorrect for this vulnerability. Real-world risk is medium-high for systems actively running ksmbd exposed to untrusted networks; the slow-leak nature means impact accumulates over time rather than from a single packet, requiring sustained attack or a busy server.

Exploit ScenarioDerived

A remote, unauthenticated attacker on the network sends a stream of malformed SMB2 SESSION_SETUP requests carrying ASN.1 BER blobs where the mechToken element parses successfully but a subsequent element (e.g., a malformed mechListMIC[3]) causes the overall decode to fail. Each request leaks a kernel heap allocation equal to the mechToken payload size. Over minutes or hours at high request rate, kernel memory is slowly exhausted, eventually causing allocation failures and degraded or unavailable server performance. No public exploit code exists at time of analysis, but the attack logic is straightforward from reading the patch.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 24, 2026

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.

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.

Affected VersionsENISA

Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 <6c8c44e6553b9f072f62d9875e567766eb293162
Linux patch: 6.12.83
Linux patch: 6.18.24
Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 <269c800a7a7e363459291885b35f7bc72e231ed6
Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 <dd577cb55588ec3fbc66af3621280306601c4192
Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 <dd53414e301beb915fe672dc4c4a51bafb917604
Linux patch: 7.0.1
Linux patch: 6.19.14

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

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.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

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

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

4
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
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.

Threat Intelligence Overview

EPSS Score
0.0%
Top 90% exploitable
Prevalence
Medium
Linux kernel feature, but ksmbd requires explicit configuration
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

28
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +28
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

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

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