CVE-2025-37778 ksmbd: Fix dangling pointer in krb_authenticate

Critical 9.8 Published Updated

A use-after-free vulnerability in the Linux kernel's ksmbd module allows attackers to execute arbitrary code or escalate privileges via crafted SMB2 session setup requests.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-37778?

CVE-2025-37778 is a critical use after free vulnerability in Debian Debian Linux, published on 1 May 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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

ksmbd: Fix dangling pointer in krb_authenticate

krb_authenticate frees sess->user and does not set the pointer to NULL. It calls ksmbd_krb5_authenticate to reinitialise sess->user but that function may return without doing so. If that happens then smb2_sess_setup, which calls krb_authenticate, will be accessing free'd memory when it later uses sess->user.

Weakness: CWE-416

Which versions are affected by CVE-2025-37778?

It affects 2 products.

Products include Debian Debian Linux, Linux kernel.

How do I fix CVE-2025-37778?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2025-37778 being exploited?

There is no known exploitation of CVE-2025-37778 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as BELL-CVE-2025-37778, DEBIAN-CVE-2025-37778, GHSA-45gw-fx24-h4pv, ROOT-OS-DEBIAN-12-CVE-2025-37778, ROOT-OS-UBUNTU-2204-CVE-2025-37778, ROOT-OS-UBUNTU-2404-CVE-2025-37778 and 1 more.

Is CVE-2025-37778 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free