Skip to main content

FatFs CVE-2026-6685

| EUVDEUVD-2026-40996 MEDIUM
Integer Underflow (CWE-191)
2026-07-01 runZero GHSA-rggj-rv54-4gvx
6.1
CVSS 3.1 · Vendor: runZero
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain physical device access
  2. Delivery
    Mount or present fragmented FAT volume
  3. Exploit
    Trigger interleaved f_read/f_write on same file object
  4. Execution
    Unsigned subtraction wraps in sector comparison
  5. Persist
    Dirty cache flush skipped
  6. Impact
    Stale or corrupted data written to persistent storage

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Integer underflow checks
Exploitation Conditions

Physical access to the target device is required (AV:P per CVSS vector). The vulnerable code path is activated only during interleaved read/write operations on the same FIL (file object) instance, specifically when the filesystem is fragmented such that the sector pointer arithmetic in f_read()/f_write() produces an unsigned underflow in the expression fp->sect - sect. Non-interleaved (read-only or write-only) file access does not trigger the condition. The filesystem must be fragmented - a freshly formatted volume with a single large contiguous file is less likely to trigger this path. No authentication is required (PR:N) beyond physical device access. Exploitation is limited to environments where: (1) the firmware statically links FatFs R0.16 or earlier, (2) the application uses a single FIL object for both reading and writing, and (3) the underlying storage media contains fragmented FAT allocations.

Impact

The CVSS 3.1 vector (AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H, score 6.1 Medium) indicates physical access is required, which substantially limits the realistic threat surface compared to network-exploitable vulnerabilities of similar CVSS score. No privileges are required (PR:N), and complexity is low (AC:L), meaning triggering the bug itself is straightforward once access to the device is obtained. The SSVC assessment raises the operational priority: Technical Impact is rated Total (full control or data destruction possible) and Exploitation is rated PoC - meaning functional proof-of-concept code exists publicly. These SSVC signals suggest that while the attack vector is constrained to physical proximity, the ease of exploitation and severity of impact on embedded devices that trigger this path are genuinely high. EPSS data is not provided. The lack of CISA KEV listing is consistent with the AV:P constraint - mass exploitation is unlikely, but targeted attacks against specific embedded systems (industrial controllers, medical devices, IoT) with local access are plausible. C:N in the CVSS vector means confidentiality is not impacted; the risk is data corruption and system unavailability.

Exploit ScenarioDerived

An adversary with physical access to an embedded device (such as an industrial controller or IoT appliance) running firmware that uses FatFs mounts or interacts with a fragmented FAT volume - such as an SD card written across multiple non-contiguous clusters. By triggering a workload that interleaves f_read() and f_write() calls on the same file object across sector boundaries that cause unsigned wrap, the attacker causes the dirty-cache flush to be skipped, leaving inconsistent or attacker-influenced data persisted to disk instead of the correct content. A proof-of-concept demonstrating this condition has been published by runZero.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
No patch listed yet 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 01, 2026

Integer underflow in FatFs R0.16 and earlier corrupts filesystem integrity via a stale dirty-cache skip during interleaved read/write operations on fragmented volumes. The condition fp->sect - sect < cc in f_read() and f_write() uses unsigned arithmetic - when sect exceeds fp->sect, the subtraction wraps to a large unsigned value, bypassing the required cache flush and leaving stale or inconsistent data on disk. A proof-of-concept exists per SSVC assessment, and technical impact is rated Total, though physical access is required per the CVSS vector. No confirmed active exploitation (not in CISA KEV).

RemediationAI

No vendor-released patched version has been independently confirmed in the available data - the fix version is not cited in any reference. Upstream research and PoC code are available at https://github.com/runZeroInc/vulns-2026-fatfs-chance, which may contain a proposed fix or patch diff; firmware maintainers should review this repository and apply any available patch to their local FatFs copy before rebuilding. As a compensating control, applications can serialize all read/write access to a given file object to avoid interleaved operations, which eliminates the fragmented-sector code path that triggers the underflow - though this may require application-level locking and adds latency overhead. Restricting FatFs usage to read-only or write-only modes per file object (never mixing both on the same FIL instance) is a second workaround with minimal performance trade-off but requires application refactoring. Firmware owners should monitor https://elm-chan.org/fsw/ff/ for an updated release from ChaN.

Affected VersionsENISA

FatFs 0 ≤R0.16

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

FatFs (cpe:2.3:a:chan:fatfs:*:*:*:*:*:*:*:*) is a generic FAT/exFAT filesystem middleware library by ChaN (elm-chan.org), widely embedded in microcontroller projects targeting STM32, AVR, PIC, and similar platforms where it handles SD cards, USB mass storage, and on-chip flash. The vulnerability is rooted in CWE-191 (Integer Underflow): the sector comparison expression fp->sect - sect < cc is evaluated using C unsigned integer arithmetic. When the sector pointer sect is greater than the file's cached sector fp->sect, the subtraction underflows to a very large unsigned number, which satisfies < cc falsely or fails the condition incorrectly, causing the library to skip flushing its dirty sector cache. On fragmented filesystems - where sector numbers for a given file are non-contiguous - this scenario arises naturally during interleaved read/write sequences, meaning normal application workloads on real-world storage media can trigger the bug without adversarial crafting.

Know when Fatfs gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (runZero) PRIMARY 6.1 MEDIUM
AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
vuln.today AI 6.1 MEDIUM

Physical access required per embedded context; no privileges needed; integrity and availability fully impacted; no confidentiality exposure from cache-skip bug.

3.1 AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
4.0 AV:P/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (runZero).

CVSS VectorVendor: runZero

Attack Vector
Physical
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
High

DescriptionCVE.org

FatFs R0.16 and earlier exhibits a stale dirty-cache skip via unsigned-subtraction wrap in f_read() / f_write() (fp->sect - sect < cc) during interleaved read/write on fragmented filesystems. This maps to CWE-191 (Integer Underflow). Estimated CVSS v3.1 vector: CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H (6.1, Medium). The estimated CISA SSVC vectors are Exploitation: PoC, Technical Impact: Total.

Threat Intelligence Overview

EPSS Score
0.2%
Top 92% exploitable
Prevalence
Medium
ubiquitous in embedded/MCU firmware, rare in enterprise IT
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available No
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value a given integer type can store.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy