CVE-2024-43806 json
`rustix::fs::Dir` iterator with the `linux_raw` backend can cause memory explosion
published 3y ago modified 2mo ago also GHSA-c827-hfw6-qwvm , EUVD-2023-2715
- cvss
- 6.5
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.5%
- EPSS 0.5% chance of exploitation in 30 days, percentile 41%
- public exploits
- 0
- none known
Summary
Rustix is a set of safe Rust bindings to POSIX-ish APIs. When using `rustix::fs::Dir` using the `linux_raw` backend, it's possible for the iterator to "get stuck" when an IO error is encountered. Combined with a memory over-allocation issue in `rustix::fs::Dir::read_more`, this can cause quick and unbounded memory explosion (gigabytes in a few seconds if used on a hot path) and eventually lead to an OOM crash of the application. The symptoms were initially discovered in https://github.com/imsnif/bandwhich/issues/284. That post has lots of details of our investigation. Full details can be read on the GHSA-c827-hfw6-qwvm repo advisory. If a program tries to access a directory with its file descriptor after the file has been unlinked (or any other action that leaves the `Dir` iterator in the stuck state), and the implementation does not break after seeing an error, it can cause a memory explosion. As an example, Linux's various virtual file systems (e.g. `/proc`, `/sys`) can contain directories that spontaneously pop in and out of existence. Attempting to iterate over them using `rustix::fs::Dir` directly or indirectly (e.g. with the `procfs` crate) can trigger this fault condition if the implementation decides to continue on errors. An attacker knowledgeable about the implementation details of a vulnerable target can therefore try to trigger this fault condition via any one or a combination of several available APIs. If successful, the application host will quickly run out of memory, after which the application will likely be terminated by an OOM killer, leading to denial of service. This issue has been addressed in release versions 0.35.15, 0.36.16, 0.37.25, and 0.38.19. Users are advised to upgrade. There are no known workarounds for this issue.
Patch / fix
- crates.io rustix 0.35.15, 0.36.16, 0.37.25, 0.38.19
- bytecodealliance rustix 0.35.15, 0.36.16, 0.37.25, 0.38.19
- rust-rustix Debian 14, Debian 13 0.38.21-1
debian advisories DEBIAN-CVE-2024-43806
- sccache SLES for SAP 15 SP6, SLES 15 SP6-LTSS, SLE Module for Development Tools 15 SP7 0.16.0~0-150600.10.11.1
- librsvg SLES 16.0, Linux Micro 6.2, SLES for SAP applications 16.0 2.60.2-160000.1.1
- librsvg SLE Micro 5.5, SLE Micro 5.4, SLE Micro 5.3 2.52.12-150400.3.9.1
- rust-keylime Linux Micro 6.1 0.2.8+12-slfo.1.1_1.1
- rust-keylime SLE Micro 5.5 0.2.7+141-150500.3.5.1
- rust-keylime SLE Micro 5.4 0.2.7+141-150400.3.5.1
- rust-keylime SLE Micro 5.3 0.2.7+141-150400.3.7.1
- rust-keylime Linux Micro 6.0 0.2.6+13-1.1
suse advisories SUSE-SU-2026:3022-1SUSE-SU-2026:20755-1SUSE-SU-2026:20910-1SUSE-SU-2025:4411-1SUSE-SU-2025:20858-1SUSE-SU-2025:02811-1
- librsvg openSUSE Leap 16.0 2.60.2-160000.1.1
- rust-keylime openSUSE Tumbleweed 0.2.7+70-2.1
- rage-encryption openSUSE Tumbleweed 0.10.0+0-3.1
- 389-ds openSUSE Tumbleweed 3.1.1~git13.a9c7ff9-1.1
opensuse advisories openSUSE-SU-2026:20396-1openSUSE-SU-2025:15294-1openSUSE-SU-2024:14354-1openSUSE-SU-2024:14306-1
- cloud-hypervisor CBL-Mariner 2.0 32.0-7
- rust CBL-Mariner 2.0 1.72.0-9
- virtiofsd CBL-Mariner 2.0, Azure Linux 3.0 1.8.0-3
- kata-containers-cc CBL-Mariner 2.0 3.2.0.azl2-7
- flux Azure Linux 3.0 0.194.5-4
- kata-containers-cc Azure Linux 3.0 3.2.0.azl4-1
- kata-containers Azure Linux 3.0 3.2.0.azl4-1
azure linux advisories AZL-48300AZL-48304AZL-48312AZL-48318AZL-48324AZL-48327
Azure Linux vulnerability data, Copyright (c) Microsoft Corporation, from https://github.com/microsoft/AzureLinuxVulnerabilityData via OSV, under the MIT licence; changed: normalised to fixed package versions per release. MIT
Is CVE-2024-43806 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerCISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- no
- Technical impact
- partial
- Assessed
- 2y ago
Exploit prediction
0.48% chance of exploitation in the next 30 days, higher than 41% of all scored CVEs (FIRST EPSS, 2026-11-11).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 3.1 | 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| crates.io | rustix | >=0.35.11, <0.35.15 >=0.36.0, <0.36.16 >=0.37.0, <0.37.25 >=0.38.0, <0.38.19 |
0.35.15 0.36.16 0.37.25 0.38.19 |
Affected products
- bytecodealliance rustix
Classification
- Weakness
-
- CWE-400 Uncontrolled Resource Consumption
References
-
github.com
/bytecodealliance/rustix/commit/31fd98ca723b93cc6101a3e29843ea5cf094e159
web
-
github.com
/bytecodealliance/rustix/commit/87481a97f4364d12d5d6f30cdd025a0fc509b8ec
web
-
github.com
/bytecodealliance/rustix/commit/df3c3a192cf144af0da8a57417fb4addbdc611f6
web
-
github.com
/bytecodealliance/rustix/commit/eecece4a84fc58eafdc809cc2cedd374dee876a5
web
-
github.com
/bytecodealliance/rustix/security/advisories/GHSA-c827-hfw6-qwvm
web
-
github.com
/imsnif/bandwhich/issues/284
web
-
nvd.nist.gov
/vuln/detail/CVE-2024-43806
advisory
-
github.com
/imsnif/bandwhich/issues/284#issuecomment-1754321993
web
-
discord.com
/channels/273534239310479360/1161137828395237556
web
-
github.com
/bytecodealliance/rustix
package
Sources
- CVE List CVE-2024-43806
- GitHub Advisory GHSA-c827-hfw6-qwvm
- NVD CVE-2024-43806
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.