# CVE-2026-6687: ChaN FatFs stack overflow in f_getlabel

Source: https://junglewise.ai/threats/cve-2026-6687-chan-fatfs-stack-overflow-in-f-getlabel  
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-6687 · Severity: high · CVSS 7.6 · Published 2026-07-01

FatFs is a widely used software library that allows embedded devices, such as industrial controllers and consumer electronics, to read and write data to SD cards and USB drives. A security flaw in how the library handles disk labels allows a specially crafted storage device to crash the system or potentially take control of the device when it is plugged in. This could lead to a complete compromise of the affected hardware, impacting operations or allowing unauthorized access to sensitive data stored on the device.

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

## Quick answers

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

**How severe is CVE-2026-6687?** High severity, with a CVSS score of 7.6, published 1 July 2026.

**Which products and versions are affected?** ChaN FatFs R0.16 and earlier.

**Is there a fix for CVE-2026-6687?** 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-6687 attacked?** It is attacked with physical access, in a software library.

**Am I affected by CVE-2026-6687?** 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 stack-based buffer overflow (CWE-121) exists in the f_getlabel() function of FatFs R0.16 and earlier. The vulnerability is caused by the software trusting the exFAT volume label length field (XDIR_NumLabel) from the disk without validating it against the specification maximum of 11 characters. Because XDIR_NumLabel is a byte, an attacker can specify a much larger value (up to 255), causing a loop to copy data into fixed-size stack buffers (typically 12 or 24 bytes) used by calling applications. This physical attack vector requires the insertion of a maliciously formatted exFAT storage device. Successful exploitation can lead to arbitrary code execution on bare-metal targets that lack modern memory protections.

## Affected products

- ChaN (elm-chan.org) FatFs R0.16 and earlier

## Timeline

- 2026-03-17: disclosed: Initial findings discovered by runZero researchers
- 2026-04-20: other: CVE IDs reserved and initial outreach to vendor
- 2026-07-01: advisory: Public advisory published by runZero and NVD

## 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-exfat-label-len-of-cve-2026-6687/](https://www.runzero.com/advisories/fatfs-exfat-label-len-of-cve-2026-6687/)
- [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 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 infinite loop in GPT partition scanning](https://junglewise.ai/threats/cve-2026-6684-chan-fatfs-infinite-loop-in-gpt-partition-scanning)
- [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)
