CVE-2025-21893
Published: 31 March 2025
Summary
CVE-2025-21893 is a high-severity Use After Free (CWE-416) vulnerability in Linux Linux Kernel. Its CVSS base score is 7.8 (High).
Operationally, exploitation aligns with the MITRE ATT&CK technique Exploitation for Privilege Escalation (T1068); ranked at the 15.3th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.
The strongest mitigations our analysis identified are NIST 800-53 SI-2 (Flaw Remediation) and RA-5 (Vulnerability Monitoring and Scanning).
Deeper analysis
CVE-2025-21893 is a use-after-free (UAF) vulnerability in the Linux kernel's keys subsystem, specifically within the key_put() function. The flaw occurs when a key's reference count drops to zero, after which the kernel's garbage collector thread may destroy the key at any time. However, key_put() accesses the key structure beyond this point in an attempt to accelerate quota reclamation, violating the constraint that it should not touch the key post-decrement except for the static global key_gc_work variable. This issue is classified under CWE-416 and carries a CVSS v3.1 base score of 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
A local attacker with low privileges can exploit this vulnerability without requiring user interaction. Exploitation involves manipulating key reference counts to trigger the UAF condition in key_put(), potentially leading to high-impact consequences such as unauthorized data access, memory corruption, arbitrary code execution, or denial of service through system instability.
Mitigation is addressed in the referenced stable kernel patches: commits 6afe2ea2daec156bd94ad2c5a6f4f4c48240dcd3, 75845c6c1a64483e9985302793dbf0dfa5f71e32, and f6a3cf833188e897c97028cd7b926e3f2cb1a8c0. These fixes introduce a flag to signal immediate garbage collection eligibility for the key, avoiding direct inspection of the reference count in the collector and preventing post-zero access in key_put(). Security practitioners should update to kernels incorporating these commits.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2025-8870
Vulnerability details
In the Linux kernel, the following vulnerability has been resolved: keys: Fix UAF in key_put() Once a key's reference count has been reduced to 0, the garbage collector thread may destroy it at any time and so key_put() is not…
more
allowed to touch the key after that point. The most key_put() is normally allowed to do is to touch key_gc_work as that's a static global variable. However, in an effort to speed up the reclamation of quota, this is now done in key_put() once the key's usage is reduced to 0 - but now the code is looking at the key after the deadline, which is forbidden. Fix this by using a flag to indicate that a key can be gc'd now rather than looking at the key's refcount in the garbage collector.
- CWE(s)
Related Threats
MITRE ATT&CK Enterprise TechniquesAI
Why these techniques?
Local use-after-free in Linux kernel keys subsystem enables arbitrary code execution/privilege escalation by low-privileged attacker, directly mapping to exploitation for privilege escalation.
CVEs Like This One
Affected Assets
Mitigating Controls
Mitigating Controls (NIST 800-53 r5) AI
Directly mitigates CVE-2025-21893 by requiring timely remediation through application of the specific Linux kernel patches that fix the UAF in key_put().
Provides kernel memory protections that mitigate exploitation of the UAF vulnerability for unauthorized access, modification, or execution.
Enables detection of the CVE-2025-21893 vulnerability in Linux kernels through regular scanning, facilitating timely patching.