CVE-2024-43806 `rustix::fs::Dir` iterator with the `linux_raw` backend can cause memory explosion
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- Proof of concept public · automatable: no · technical impact: partial
- Technology
- UbuntuDebian
Description
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.
Upgrade path
9 packages: 5 fixed, 4 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| debian/rust-rustix(Debian 12) | = 0.35.12-1; = 0.37.20-1; = 0.37.20-2; = 0.38.9-1 +21 more | No fix listed | No fix yet |
| ubuntu/rust-rustix(Ubuntu 24.04) | All versions | No fix listed | No fix yet |
| ubuntu/rust-rustix(Ubuntu 26.04) | All versions | No fix listed | No fix yet |
| ubuntu/rust-rustix(Ubuntu 26.10) | All versions | No fix listed | No fix yet |
| bytecodealliance 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 +4 more | 0.35.15, 0.36.16, 0.37.25, 0.38.19 | Fixed |
| crates.io rustix(crates.io) | >= 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 | Fixed |
| debian/rust-rustix(Debian 13) | < 0.38.21-1 | 0.38.21-1 | Fixed |
| debian/rust-rustix(Debian 14) | < 0.38.21-1 | 0.38.21-1 | Fixed |
| Microsoft cbl mariner | < 1.72.0-9 | 1.72.0-9 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| Microsoft cbl mariner | < 1.72.0-9 | 1.72.0-9 |
| crates.io rustix(crates.io) | >= 0.35.11, < 0.35.15 | 0.35.15 |
| crates.io rustix(crates.io) | >= 0.36.0, < 0.36.16 | 0.36.16 |
| crates.io rustix(crates.io) | >= 0.37.0, < 0.37.25 | 0.37.25 |
| crates.io rustix(crates.io) | >= 0.38.0, < 0.38.19 | 0.38.19 |
| debian/rust-rustix(Debian:12) | All versions | No fix listed |
| debian/rust-rustix(Debian:12) | = 0.35.12-1 | No fix listed |
| debian/rust-rustix(Debian:12) | = 0.37.20-1 | No fix listed |
| debian/rust-rustix(Debian:12) | = 0.37.20-2 | No fix listed |
| debian/rust-rustix(Debian:12) | = 0.38.17-1 | No fix listed |
| debian/rust-rustix(Debian:12) | = 0.38.21-1 | No fix listed |
| debian/rust-rustix(Debian:12) | = 0.38.25-1 | No fix listed |
| debian/rust-rustix(Debian:12) | = 0.38.30-1 | No fix listed |
| debian/rust-rustix(Debian:12) | = 0.38.32-1 | No fix listed |
| debian/rust-rustix(Debian:12) | = 0.38.32-1+hurd.1 | No fix listed |
| debian/rust-rustix(Debian:12) | = 0.38.32-1+hurd.2 | No fix listed |
| debian/rust-rustix(Debian:12) | = 0.38.37-1 | No fix listed |
| debian/rust-rustix(Debian:12) | = 0.38.37-2 | No fix listed |
| debian/rust-rustix(Debian:12) | = 0.38.37-3 | No fix listed |
| debian/rust-rustix(Debian:12) | = 0.38.37-4 | No fix listed |
| debian/rust-rustix(Debian:12) | = 0.38.9-1 | No fix listed |
| debian/rust-rustix(Debian:12) | = 1.0.8-1 | No fix listed |
| debian/rust-rustix(Debian:12) | = 1.0.8-2 | No fix listed |
| debian/rust-rustix(Debian:12) | = 1.0.8-3 | No fix listed |
| debian/rust-rustix(Debian:12) | = 1.1.2-1 | No fix listed |
Show 18 more
| Product | Affected versions | Fixed in |
|---|---|---|
| debian/rust-rustix(Debian:12) | = 1.1.2-2 | No fix listed |
| debian/rust-rustix(Debian:12) | = 1.1.3-1 | No fix listed |
| debian/rust-rustix(Debian:12) | = 1.1.3-1+hurd.1 | No fix listed |
| debian/rust-rustix(Debian:12) | = 1.1.4+dfsg-1 | No fix listed |
| debian/rust-rustix(Debian:12) | = 1.1.5+ds-1 | No fix listed |
| debian/rust-rustix(Debian:13) | < 0.38.21-1 | 0.38.21-1 |
| debian/rust-rustix(Debian:14) | < 0.38.21-1 | 0.38.21-1 |
| bytecodealliance rustix | = >= 0.35.11, < 0.35.15 | No fix listed |
| bytecodealliance rustix | = >= 0.36.0, < 0.36.16 | No fix listed |
| bytecodealliance rustix | = >= 0.37.0, < 0.37.25 | No fix listed |
| bytecodealliance rustix | = >= 0.38.0, < 0.38.19 | No fix listed |
| bytecodealliance rustix | >= 0.35.11, < 0.35.15 | 0.35.15 |
| bytecodealliance rustix | >= 0.36.0, < 0.36.16 | 0.36.16 |
| bytecodealliance rustix | >= 0.37.0, < 0.37.25 | 0.37.25 |
| bytecodealliance rustix | >= 0.38.0, < 0.38.19 | 0.38.19 |
| ubuntu/rust-rustix(Ubuntu:24.04) | All versions | No fix listed |
| ubuntu/rust-rustix(Ubuntu:26.04) | All versions | No fix listed |
| ubuntu/rust-rustix(Ubuntu:26.10) | All versions | No fix listed |
References
- MSRC Security Update Guide vendor-advisory
- rust third-party-advisory vendor-advisory
- https://github.com/bytecodealliance/rustix/security/advisories/GHSA-c827-hfw6-qwvm vendor-advisory
- https://github.com/imsnif/bandwhich/issues/284
- github.com patch
- github.com patch
- github.com patch
- github.com patch
- discord.com
- github.com product
- github.com
- Debian Security Tracker CVE-2024-43806 vendor-advisory
- Ubuntu CVE tracker vendor-advisory
- www.cve.org