# CVE-2026-6684: ChaN FatFs infinite loop in GPT partition scanning

Source: https://junglewise.ai/threats/cve-2026-6684-chan-fatfs-infinite-loop-in-gpt-partition-scanning  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-01. Updated: 2026-07-01  
License: CC BY 4.0 with a link back

CVE-2026-6684 · Severity: medium · CVSS 4.6 · Published 2026-07-01

FatFs is a widely used software library that allows small embedded devices, such as industrial controllers and consumer electronics, to read files from storage media like SD cards. A flaw in how the library handles certain partition data allows a specially crafted storage device to cause the system to hang indefinitely during startup. This can result in a permanent denial of service, preventing the device from booting or functioning until the malicious storage media is removed or the firmware is recovered.

Technologies: [ChaN FatFs](https://junglewise.ai/threats/technologies/fatfs). Vendors: [ChaN](https://junglewise.ai/threats/vendors/chan).

## Quick answers

**Is CVE-2026-6684 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-6684 being exploited in the wild.

**How severe is CVE-2026-6684?** Medium severity, with a CVSS score of 4.6, published 1 July 2026.

**Which products and versions are affected?** ChaN FatFs Prior to R0.16 with FF_LBA64 = 1 enabled.

**Is there a fix for CVE-2026-6684?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-6684 attacked?** It is attacked with physical access, in a software library.

**Am I affected by CVE-2026-6684?** Check whether you run ChaN FatFs at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A vulnerability classified as CWE-835 (Loop with Unreachable Exit Condition) exists in FatFs prior to version R0.16 when configured with 'FF_LBA64 = 1'. The issue stems from the GPT partition scanning logic, which trusts the partition-entry count (GPTH_PtNum) provided by the on-disk GPT header without sufficient validation or hard caps. An attacker with physical access can provide a crafted GPT image with a maximized partition count (e.g., 0xFFFFFFFF), forcing the library into a massive read loop during the mount process. This typically results in a system hang or boot failure, especially on bare-metal targets lacking a watchdog timer. The issue was addressed in R0.16 by adding the test_gpt_header() function to validate partition counts and CRCs.

## Affected products

- ChaN FatFs Prior to R0.16 with FF_LBA64 = 1 enabled

## Timeline

- 2026-03-17: disclosed: Initial findings discovered by runZero researchers
- 2026-07-01: advisory: NVD publication date

## References

- [https://elm-chan.org/fsw/ff/](https://elm-chan.org/fsw/ff/)
- [https://github.com/runZeroInc/vulns-2026-fatfs-chance](https://github.com/runZeroInc/vulns-2026-fatfs-chance)
- [https://www.runzero.com/advisories/fatfs-gpt-scan-loop-dos-cve-2026-6684/](https://www.runzero.com/advisories/fatfs-gpt-scan-loop-dos-cve-2026-6684/)
- [https://www.runzero.com/blog/fatfs-bugs/](https://www.runzero.com/blog/fatfs-bugs/)

## Related threats

- [ChaN FatFs buffer overflow in long filename handling](https://junglewise.ai/threats/cve-2026-6688-chan-fatfs-buffer-overflow-in-long-filename-handling)
- [ChaN FatFs stack overflow in f_getlabel](https://junglewise.ai/threats/cve-2026-6687-chan-fatfs-stack-overflow-in-f-getlabel)
- [ChaN FatFs uninitialized cluster exposure in f_lseek](https://junglewise.ai/threats/cve-2026-6686-chan-fatfs-uninitialized-cluster-exposure-in-f-lseek)
- [ChaN FatFs integer underflow in f_read and f_write](https://junglewise.ai/threats/cve-2026-6685-chan-fatfs-integer-underflow-in-f-read-and-f-write)
- [ChaN FatFs divide by zero in exFAT sync logic](https://junglewise.ai/threats/cve-2026-6683-chan-fatfs-divide-by-zero-in-exfat-sync-logic)
