CVE-2025-40287 exfat: fix improper check of dentry.stream.valid_size

Not scored Published Updated

A local attacker can cause a kernel hang and denial of service by mounting a malformed exFAT filesystem and triggering specific system calls.

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-40287?

CVE-2025-40287 is a denial of service vulnerability in Linux, published on 6 Dec 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:

exfat: fix improper check of dentry.stream.valid_size

We found an infinite loop bug in the exFAT file system that can lead to a Denial-of-Service (DoS) condition. When a dentry in an exFAT filesystem is malformed, the following system calls — SYS_openat, SYS_ftruncate, and SYS_pwrite64 — can cause the kernel to hang.

Root cause analysis shows that the size validation code in exfat_find() does not check whether dentry.stream.valid_size is negative. As a result, the system calls mentioned above can succeed and eventually trigger the DoS issue.

This patch adds a check for negative dentry.stream.valid_size to prevent this vulnerability.

Which versions are affected by CVE-2025-40287?

How do I fix CVE-2025-40287?

Apply the vendor's patch.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2025-40287 being exploited?

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

Sources

Also known as BELL-CVE-2025-40287, DEBIAN-CVE-2025-40287, GHSA-vj97-73gp-638r, ROOT-OS-DEBIAN-12-CVE-2025-40287, ROOT-OS-DEBIAN-13-CVE-2025-40287, ROOT-OS-UBUNTU-2204-CVE-2025-40287 and 2 more.

Is CVE-2025-40287 in your software?

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

Check your SBOMs for free