Executive brief
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.
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