CVE-2025-71472 in littlefs
Summary
by MITRE • 11/19/2026
littlefs 2.8.0 through 2.11.3 contains a divide-by-zero vulnerability in lfs_mount_() that allows attackers to crash processes mounting crafted filesystem images when block_count is 0. Attackers can supply an image lacking a superblock entry or recording block_count 0, causing lfs->seed % lfs->block_count to trigger SIGFPE and denial of service.
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
Analysis
by VulDB Data Team • 11/21/2026
The vulnerability identified in littlefs versions 2.8.0 through 2.11.3 represents a critical arithmetic error within the filesystem mounting routine, specifically located in the lfs_mount_ function. This flaw arises from an insufficient validation check for the block_count parameter during the initialization phase of the filesystem structure. When a crafted filesystem image is provided that either lacks a valid superblock entry or explicitly records a block count of zero, the internal logic proceeds to perform arithmetic operations without verifying that the divisor is non-zero. This specific condition triggers a divide-by-zero exception, which on most operating systems results in the generation of a SIGFPE signal. The immediate operational consequence of this event is the abrupt termination of the process attempting to mount the filesystem, leading to a denial of service for any application relying on littlefs for storage management.
From a technical perspective, the root cause lies in the failure to validate input data integrity before performing mathematical operations that depend on structural parameters derived from the disk image. The expression lfs->seed % lfs->block_count assumes that block_count is greater than zero, as modulo division by zero is undefined and causes hardware-level exceptions. In embedded systems where littlefs is commonly deployed, such crashes can be particularly detrimental because they may occur during critical boot sequences or when accessing storage media in resource-constrained environments. The lack of a superblock entry further exacerbates the issue, as it indicates that the filesystem metadata is either corrupted or intentionally malformed to exploit this logic gap. This type of vulnerability falls under CWE-369, which classifies divide-by-zero errors, and highlights the importance of rigorous input validation in low-level system software.
The impact of this vulnerability extends beyond simple process termination. In systems where littlefs manages persistent storage for critical functions, such as IoT device configuration or firmware partitioning, a crash during mount operations can lead to data inconsistency if partial writes have occurred prior to the failure. Furthermore, an attacker with physical access to the storage medium or network access to supply crafted images in distributed file synchronization scenarios could exploit this flaw to disrupt service availability. This aligns with ATT&CK technique T1499, Endpoint Denial of Service, as it involves manipulating system resources to cause a disruption in normal operations. The ability to trigger a crash via a malformed image underscores the risk associated with trusting external or unverified storage media without proper sanitization and validation checks.
Mitigation strategies for this vulnerability primarily involve updating littlefs to version 2.11.4 or later, where the developers have implemented necessary safeguards to prevent division by zero. For systems that cannot be immediately updated, defensive programming practices should be adopted within the application layer wrapping littlefs calls. This includes validating the superblock structure and ensuring block_count is greater than zero before invoking mount functions. Additionally, implementing robust error handling mechanisms can help isolate faults caused by malformed images from affecting critical system processes. Regular auditing of filesystem metadata integrity during initialization phases is also recommended to detect anomalies early in the boot or access cycle, thereby preventing the execution of unsafe arithmetic operations and maintaining system stability against crafted inputs.