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

- Priority: **Routine**
- Reason: Not severe (CVSS 6.5, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-08-26 · Modified: 2024-08-26
- Aliases: SUSE-SU-2024:3404-1, UBUNTU-CVE-2024-43806, DEBIAN-CVE-2024-43806, CGA-3g38-536p-j4wr, CGA-3m93-9p84-vx8x, CGA-3mrw-9fmq-pmc3, CGA-4ccc-pw24-3j9h, CGA-53w7-x624-7px5, CGA-58v7-xpw7-57w7, CGA-5hr9-j2mw-c33g, CGA-6gf7-c3r8-hw33, CGA-8529-r59q-p278, CGA-929h-g48q-7pg2, CGA-97v7-v4jq-45f8, CGA-f452-9m8p-hv4q, CGA-f495-6rw4-c6w3, CGA-ggmr-mmcw-548x, CGA-jjvj-w2v3-jmm9, CGA-vxpw-387j-6cfp, CGA-xmmp-6762-896c, CGA-xpw5-wffv-cp77, openSUSE-SU-2024:14306-1, openSUSE-SU-2024:14354-1, GHSA-c827-hfw6-qwvm
- Record: https://cvemate.com/vulnerability/CVE-2024-43806 · JSON: https://cvemate.com/vulnerability/CVE-2024-43806/json

## Description

```text
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.
```

## Signals

- CVSS: 6.5 medium (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- EPSS: 0.48%, percentile 43.08%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 28)

- chainguard bat (Chainguard): \< 0.24.0-r2
- chainguard bat-doc (Chainguard): \< 0.24.0-r2
- chainguard berg (Chainguard): \< 0.3.5-r2
- chainguard pgcat (Chainguard): \< 1.2.0-r1
- chainguard zed (Chainguard): \< 0.147.2-r0
- chainguard zellij (Chainguard): \< 0.42.1-r0
- chainguard zellij-bash-completion (Chainguard): \< 0.42.1-r0
- chainguard zellij-fish-completion (Chainguard): \< 0.42.1-r0
- chainguard zellij-zsh-completion (Chainguard): \< 0.42.1-r0
- wolfi bat (Wolfi): \< 0.24.0-r2
- wolfi bat-doc (Wolfi): \< 0.24.0-r2
- wolfi berg (Wolfi): \< 0.3.5-r2
- wolfi pgcat (Wolfi): \< 1.2.0-r1
- wolfi zed (Wolfi): \< 0.147.2-r0
- wolfi zellij (Wolfi): \< 0.42.1-r0
- wolfi zellij-bash-completion (Wolfi): \< 0.42.1-r0
- wolfi zellij-fish-completion (Wolfi): \< 0.42.1-r0
- wolfi zellij-zsh-completion (Wolfi): \< 0.42.1-r0
- 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
- 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

## References

- <https://github.com/bytecodealliance/rustix/security/advisories/GHSA-c827-hfw6-qwvm>
- <https://github.com/imsnif/bandwhich/issues/284>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20243404-1/>
- <https://bugzilla.suse.com/1229959>
- <https://www.suse.com/security/cve/CVE-2024-43806>
- <https://ubuntu.com/security/CVE-2024-43806>
- <https://www.cve.org/CVERecord?id=CVE-2024-43806>
- <https://security-tracker.debian.org/tracker/CVE-2024-43806>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/43xxx/CVE-2024-43806.json>
- <https://nvd.nist.gov/vuln/detail/CVE-2024-43806>
- <https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/TXPZZSAXTA6CTQAGWASRTKWJQ3DFB7GG/>
- <https://github.com/imsnif/bandwhich/issues/284#issuecomment-1754321993>
- <https://github.com/bytecodealliance/rustix/commit/31fd98ca723b93cc6101a3e29843ea5cf094e159>
- <https://github.com/bytecodealliance/rustix/commit/87481a97f4364d12d5d6f30cdd025a0fc509b8ec>
- <https://github.com/bytecodealliance/rustix/commit/df3c3a192cf144af0da8a57417fb4addbdc611f6>
- <https://github.com/bytecodealliance/rustix/commit/eecece4a84fc58eafdc809cc2cedd374dee876a5>
- <https://discord.com/channels/273534239310479360/1161137828395237556>
- <https://github.com/bytecodealliance/rustix>

---

Data as of 2026-12-05T09:44:22.197Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
