# CVE-2024-43806: \`rustix::fs::Dir\` iterator with the \`linux\_raw\` backend can cause memory explosion

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 6.5
- **CVSS:** 6.5 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, login needed
- **EPSS:** 0.84% (percentile 55, 2026-11-28)
- **CWE:** CWE-400
- **Aliases:** GHSA-c827-hfw6-qwvm
- **Published:** 2023-10-18T18:27:47.000Z
- **Modified:** 2026-09-10T03:50:03.698Z

## Who should check

- Projects that depend on crates.io package rustix (\>= 0.35.11, \< 0.35.15)
- Anyone running 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

## 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.

## Affected and fixed versions

- crates.io `rustix`: affected \>= 0.35.11, \< 0.35.15; fixed 0.35.15, 0.36.16, 0.37.25, 0.38.19 (osv)
- 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 (cvelist)

## Mitigation

- Upgrade rustix to one of 0.35.15, 0.36.16, 0.37.25, 0.38.19 (or later in the same release line).

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-43806. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-43806.md
Affected: rustix >= 0.35.11, < 0.35.15
Fixed in: 0.35.15, 0.36.16, 0.37.25, 0.38.19

Steps:
1. Search this machine and project for rustix (crates.io), bytecodealliance rustix: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-43806 being exploited?

There is no confirmed exploitation: CVE-2024-43806 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.84% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2024-43806?

Medium: CVSS 6.5 (v3.1, scored by CNA). Remote, login needed.

### Which versions are affected by CVE-2024-43806?

rustix \>= 0.35.11, \< 0.35.15.

### Is there a fix for CVE-2024-43806?

Yes. Fixed in 0.35.15, 0.36.16, 0.37.25, 0.38.19. Upgrade rustix to one of 0.35.15, 0.36.16, 0.37.25, 0.38.19 (or later in the same release line).

### How do I check if I'm affected by CVE-2024-43806?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/bytecodealliance/rustix/security/advisories/GHSA-c827-hfw6-qwvm>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2024-43806>
- patch: <https://github.com/bytecodealliance/rustix/commit/31fd98ca723b93cc6101a3e29843ea5cf094e159>
- patch: <https://github.com/bytecodealliance/rustix/commit/87481a97f4364d12d5d6f30cdd025a0fc509b8ec>
- patch: <https://github.com/bytecodealliance/rustix/commit/df3c3a192cf144af0da8a57417fb4addbdc611f6>
- patch: <https://github.com/bytecodealliance/rustix/commit/eecece4a84fc58eafdc809cc2cedd374dee876a5>
- other: <https://github.com/imsnif/bandwhich/issues/284>
- other: <https://github.com/imsnif/bandwhich/issues/284#issuecomment-1754321993>
- other: <https://discord.com/channels/273534239310479360/1161137828395237556>
- other: <https://github.com/bytecodealliance/rustix>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-43806>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-c827-hfw6-qwvm> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2024-43806> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-43806>
