CVE-2024-43882: exec: Fix ToCToU between perm check and set-uid/gid usage
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.
Security readout for executives and security teams
Plain-English summary
CVE-2024-43882 is a Linux kernel flaw where a program’s permissions can change between the execution permission check and later setuid/setgid handling. In a narrow race, a local user may execute a file just before permissions tighten and still receive elevated privileges afterward.
Executive priority
Treat this as high priority for shared Linux servers, developer hosts, and managed appliances with local user access. It is not a remote network-entry issue, but successful exploitation could turn ordinary local access into root privileges.
Technical view
The bug is a CWE-367 time-of-check/time-of-use issue in the Linux exec path. do_filp_open() validates execute permission, but later execve() logic uses potentially changed inode mode, uid, and gid to decide setuid/setgid behavior. The fix re-checks execute permission under the inode lock before applying privilege changes.
Likely exposure
Exposure is mainly Linux systems where local untrusted users can run processes, especially during package or permission updates involving setuid programs. The supplied affected data names Linux kernels and downstream advisories, but exact exposure should be determined from vendor backports rather than version strings alone.
Exploitation context
The source states the race is rare in real-world scenarios but proven exploitable when package managers update setuid bits. CISA KEV is false in the bundle, and no supplied source states active exploitation in the wild.
Researcher notes
The important validation question is whether the vendor kernel includes the exec permission re-check fix, not whether the upstream version number appears vulnerable. The source bundle does not provide safe reproduction details, active exploitation evidence, or a universal mitigation other than applying vendor fixes.
Mitigation direction
Apply kernel updates from the operating system or appliance vendor.
Prioritize multi-user servers and systems allowing untrusted local code execution.
Check Debian LTS and vendor advisories for fixed package availability.
For embedded or appliance systems, follow the vendor advisory rather than upstream versions alone.
Validation and detection
Inventory running Linux kernel versions across servers, containers, and appliances.
Confirm vendor security updates containing the CVE-2024-43882 fix are installed.
Review package-management workflows on systems with local users and setuid binaries.
Track exceptions where vendor advisories are pending or fixes are not yet available.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-367: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
3ADP providers
14Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-367 · source CWE mapping
Time-of-check Time-of-use (TOCTOU) Race Condition
Time-of-check Time-of-use (TOCTOU) Race Condition represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.