CVE-2025-21660 ksmbd: fix unexpectedly changed path in ksmbd_vfs_kern_path_locked

Medium 5.5 Published Updated

An attacker can exploit a path handling error in the ksmbd kernel module to modify files or execute code via unexpected path changes.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-21660?

CVE-2025-21660 is a medium-severity path traversal vulnerability in Linux kernel, published on 21 Jan 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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

ksmbd: fix unexpectedly changed path in ksmbd_vfs_kern_path_locked

When `ksmbd_vfs_kern_path_locked` met an error and it is not the last entry, it will exit without restoring changed path buffer. But later this buffer may be used as the filename for creation.

Which versions are affected by CVE-2025-21660?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2025-21660?

Apply the vendor's patch.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2025-21660 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2025-21660, DEBIAN-CVE-2025-21660, GHSA-jj94-6v6v-cc35, UBUNTU-CVE-2025-21660.

Is CVE-2025-21660 in your software?

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

Check your SBOMs for free