CVE-2024-43882·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: exec: Fix ToCToU between perm check and set-uid/gid usage When opening a file for exec via do_filp_open(), permission checking is done against the file's metadata at that moment, and on success, a file pointer is passed back. Much later in the execve() code path, the file metadata (specifically mode, uid, and gid) is used to determine if/how to set the uid and gid. However, those values may have changed since the permissions check, meaning the execution may gain unintended privileges. For example, if a file could change permissions from executable and not set-id: ---------x 1 root root 16048 Aug 7 13:16 target to set-id and non-executable: ---S------ 1 root root 16048 Aug 7 13:16 target it is possible to gain root privileges when execution should have been disallowed. While this race condition is rare in real-world scenarios, it has been observed (and proven exploitable) when package managers are updating the setuid bits of installed programs. Such files start with being world-executable but then are adjusted to be group-exec with a set-uid bit. For example, "chmod o-x,u+s target" makes "target" executable only by uid "root" and gid "cdrom", while also becoming setuid-root: -rwxr-xr-x 1 root cdrom 16048 Aug 7 13:16 target becomes: -rwsr-xr-- 1 root cdrom 16048 Aug 7 13:16 target But racing the chmod means users without group "cdrom" membership can get the permission to execute "target" just before the chmod, and when the chmod finishes, the exec reaches brpm_fill_uid(), and performs the setuid to root, violating the expressed authorization of "only cdrom group members can setuid to root". Re-check that we still have execute permissions in case the metadata has changed. It would be better to keep a copy from the perm-check time, but until we can do that refactoring, the least-bad option is to do a full inode_permission() call (under inode lock). It is understood that this is safe against dead-locks, but hardly optimal.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.10.6
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at <0.1% — higher than 5% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Read the two together. CVE-2024-43882 scores 7 on CVSS, so a successful attack would be serious — but at <0.1%, almost nobody is currently attempting it. That is a different situation from a flaw under mass exploitation, and it is usually the difference between patching on your next maintenance window and patching tonight.
Affected versions
From: 6.7
Until: 6.10.6
Fixed in: 6.10.6
How to fix this CVE
Update your Linux kernel to version 6.10.6 or later to patch a race condition in the exec subsystem that could allow privilege escalation. This vulnerability affects kernels 6.7 through 6.10.5 and occurs when file permissions change between the initial permission check and the actual setuid/setgid operation. Apply the kernel update immediately and reboot your system to mitigate the risk.
sudo dnf update kernel kernel-devel && sudo rebootDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check current kernel version with `uname -r` and compare against fixed version 6.10.6 or later
- Step 2: Verify if setuid/setgid binaries exist on the system with `find / -perm /4000 -o -perm /2000 2>/dev/null | head -20`
- Step 3: Search system logs for suspicious permission changes during exec operations: `grep -i 'permission\|chmod\|exec' /var/log/audit/audit.log | tail -100`
- Step 4: After applying the kernel update, confirm the patch was installed with `uname -r` and verify it shows kernel version 6.10.6 or higher
FAQ
What is CVE-2024-43882?
CVE-2024-43882 is a time-of-check-to-time-of-use (ToCToU) race condition in the Linux kernel's exec subsystem. An attacker can exploit a window between the initial permission check and the actual setuid/setgid operation to gain unintended elevated privileges when file permissions are modified during execution.
Is CVE-2024-43882 being actively exploited?
No, CVE-2024-43882 is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploit code is currently available. However, the vulnerability has been demonstrated to be exploitable in controlled scenarios, particularly during package manager updates.
What versions of Kernel are affected by CVE-2024-43882?
Linux kernel versions 6.7 through 6.10.5 are vulnerable. Version 6.10.6 and later contain the fix that re-checks execute permissions under inode lock to prevent the race condition.
How do I check if my server is vulnerable to CVE-2024-43882?
Run `uname -r` to check your kernel version. If the version is between 6.7 and 6.10.5 (inclusive), your system is vulnerable. Systems running kernel 6.10.6 or later are patched.
Does Defensia detect CVE-2024-43882?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2024-43882 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/15469d46ba34559bfe7e3de6659115778c624759
- https://git.kernel.org/stable/c/368f6985d46657b8b466a421dddcacd4051f7ada
- https://git.kernel.org/stable/c/90dfbba89ad4f0d9c9744ecbb1adac4aa2ff4f3e
- https://git.kernel.org/stable/c/9b424c5d4130d56312e2a3be17efb0928fec4d64
- https://git.kernel.org/stable/c/d2a2a4714d80d09b0f8eb6438ab4224690b7121e
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-43882. Free for 1 server.
Get started free