⚠️

Disclaimer & Liability

The content provided on this website is for educational, research, and security awareness purposes only. Any unauthorized, illegal, or abusive use of the information, tools, and techniques discussed is solely the responsibility of the user. The author and publisher assume no liability for any damages, injuries, or consequences resulting from the misuse of this content.

CVE-2026-143080: Linux Kernel ksmbd NTLM Reauthentication Flaw Permits Expired-Session Identity Takeover | Alireza Bolbolabadi - Red Team Security
LOADING

CVE-2026-143080: Linux Kernel ksmbd NTLM Reauthentication Flaw Permits Expired-Session Identity Takeover

Background

CVE-2026-143080 addresses a session-handling defect in the ksmbd subsystem of the Linux kernel, the in-kernel implementation of an SMB/CIFS server. The vulnerability sits inside the NTLM authentication routine ntlm_authenticate() and specifically affects the path that handles reauthentication of an expired session.

What goes wrong

When an SMB2 session is still considered valid, ntlm_authenticate() already enforces that the user reauthenticating matches sess->user. The same check exists in krb5_authenticate() for Kerberos-bound sessions. The expired-session branch, however, did not perform that comparison: an expired session moves into the SMB2_SESSION_IN_PROGRESS state during reauthentication, which routes execution to a branch that simply assigns sess->user to the newly authenticated user.

Two consequences result from that branch:

  • The session's open files, tree connects, and other per-user state — originally created under the first user — are now attributed to whichever user just completed NTLM reauthentication.

  • The previously stored struct ksmbd_user is overwritten without being freed, producing a memory leak on every successful takeover.

The attacker only needs to reach the ksmbd listener and present valid NTLM credentials for any user; no prior credential of the original session owner is required at the moment of impersonation.

Resolution

The upstream kernel patch brings the expired-session NTLM branch into line with the sibling paths: it compares the new user identity against the existing sess->user, rejects a mismatch with -EKEYREJECTED, and frees the newly looked-up struct ksmbd_user in both the success and rejection paths.

Affected systems

  • Linux kernel builds that ship a vulnerable version of ksmbd's ntlm_authenticate() expired-session branch.

  • The supplied NVD record (https://nvd.nist.gov/vuln/detail/CVE-2026-143080) does not enumerate a specific affected range or a patch commit hash, so affected kernels must be confirmed against the upstream commit log.

  • Deployments that use a userspace SMB server such as Samba are unaffected, because the defect is in the in-kernel implementation.

  • Systems with ksmbd compiled but not loaded are not actively exposed, although the vulnerable code remains in the kernel image.

Mitigation

  • Patch. Apply the upstream fix that updates the expired-session branch of ntlm_authenticate() to compare against sess->user and return -EKEYREJECTED on mismatch, freeing the newly looked-up user in both outcomes. Reboot hosts running ksmbd so the new code path is loaded.

  • Disable ksmbd if unused. If the in-kernel SMB server is not strictly required, unload the module or disable it in the kernel configuration and service stack so the vulnerable path is not exposed.

  • Substitute a userspace server. When SMB file sharing remains required, retire the in-kernel implementation in favor of a userspace daemon such as Samba and ensure the ksmbd module is not loaded.

  • Operational hardening. Restrict SMB access at the network layer to known client subnets, require SMB signing to limit the value of any partially authenticated session state to an interceptor, and watch ksmbd audit output for reauthentication events against expired sessions where the user identity differs from the session owner.

  • Hygiene. Review existing open-file and tree-connect state on instances that may have served affected kernels; the leak path can also leave orphaned struct ksmbd_user entries behind.

Expert insight

The defect is a textbook authentication-state confusion bug: the code branches on session validity but consults only one of the two corresponding user-identity checks. Functions like krb5_authenticate() and the still-valid branch of ntlm_authenticate() already encode the correct invariant — "the user reauthenticating must match the user that opened the session" — so the failed invariant was already a known-good policy elsewhere in the same file. That makes the fix mechanically small and easy to validate, but the underlying trust model relies on every branch of every authentication routine enforcing the same identity rule.

It is also notable that an AI assistant was credited with finding and independently reviewing the fix. Whether discovered by human, model, or a hybrid workflow, the underlying issue is what determines the security impact: an SMB client that can reach a ksmbd instance and target an expired session can swap identities mid-session and inherit prior state.

Recommendations

  • Identify every kernel build in the environment that ships a vulnerable ntlm_authenticate() expired-session branch by mapping against the upstream commit referenced from the NVD entry.

  • Prioritise reboots or service restarts after the kernel update so the patched binary is in memory.

  • Where patching is delayed, remove or unload the ksmbd module to close the exposed code path.

  • Confirm that SMB signing is enforced on ksmbd shares to reduce the practical value of any intercepted session state.

  • Audit historical reauthentication log entries on potentially affected servers for anomalous user-swap patterns during expired-session handling.

  • Track the upstream commit for the resolved branch to incorporate the unit of identity-check enforcement into internal hardening guidelines.

Information not present in the supplied context

  • No CVSS vector or base score is published in the supplied material.

  • The advisory does not enumerate affected kernel releases, the fixing commit hash, or the introduction commit.

  • There is no record of public exploit code, in-the-wild exploitation, or CISA KEV listing.

  • A complete patching plan should incorporate those data points from the upstream kernel commit log and the full NVD entry.

References

·
← News