Skip to main content

CVE-2025-21704: Vulnerability in Linux Linux

High
VulnerabilityCVE-2025-21704cvecve-2025-21704
Published: Sat Feb 22 2025 (02/22/2025, 09:43:37 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: usb: cdc-acm: Check control transfer buffer size before access If the first fragment is shorter than struct usb_cdc_notification, we can't calculate an expected_size. Log an error and discard the notification instead of reading lengths from memory outside the received data, which can lead to memory corruption when the expected_size decreases between fragments, causing `expected_size - acm->nb_index` to wrap. This issue has been present since the beginning of git history; however, it only leads to memory corruption since commit ea2583529cd1 ("cdc-acm: reassemble fragmented notifications"). A mitigating factor is that acm_ctrl_irq() can only execute after userspace has opened /dev/ttyACM*; but if ModemManager is running, ModemManager will do that automatically depending on the USB device's vendor/product IDs and its other interfaces.

AI-Powered Analysis

AILast updated: 06/30/2025, 17:55:28 UTC

Technical Analysis

CVE-2025-21704 is a vulnerability identified in the Linux kernel's USB CDC-ACM driver, which handles USB communications for devices such as modems and serial ports exposed via /dev/ttyACM*. The flaw arises from improper validation of the control transfer buffer size during the processing of fragmented USB CDC notifications. Specifically, if the first fragment of a notification is shorter than the expected size of the usb_cdc_notification structure, the driver attempts to calculate an expected size for the entire notification. Due to insufficient checks, this calculation can underflow or wrap around when the expected size decreases between fragments, leading to memory corruption. This memory corruption could potentially be exploited to cause kernel crashes or arbitrary code execution within the kernel context. The vulnerability has existed since the introduction of fragmented notification reassembly in the driver (commit ea2583529cd1) but only manifests under specific conditions related to fragmented USB CDC notifications. A mitigating factor is that the vulnerable code path (acm_ctrl_irq()) is only executed after a userspace process opens the /dev/ttyACM* device file, which typically requires user-level interaction or automated processes such as ModemManager, which opens these devices based on USB vendor/product IDs. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet. The vulnerability affects Linux kernel versions containing the specified commit and earlier versions that implement the fragmented notification reassembly in the CDC-ACM driver.

Potential Impact

For European organizations, the impact of this vulnerability can be significant, especially for those relying on Linux-based systems that interface with USB CDC-ACM devices such as embedded systems, IoT gateways, industrial control systems, or telecommunications equipment. Exploitation could lead to kernel memory corruption, resulting in system instability, denial of service, or potentially privilege escalation if an attacker crafts malicious USB devices or manipulates USB traffic. This is particularly relevant in environments where USB modems or serial-over-USB devices are used for critical communications or device management. Given that ModemManager often automatically opens these devices, the attack surface is increased as exploitation may not require explicit user action beyond device connection. European sectors such as manufacturing, telecommunications, and critical infrastructure that use Linux-based embedded devices or network equipment could be at risk. The vulnerability could also affect cloud or data center environments if USB CDC-ACM devices are used for management or monitoring purposes. However, the requirement for device connection and opening of /dev/ttyACM* limits remote exploitation, making physical or local access a likely prerequisite.

Mitigation Recommendations

To mitigate this vulnerability, European organizations should: 1) Apply the latest Linux kernel patches that address this issue as soon as they become available, ensuring that all affected systems are updated promptly. 2) Audit and restrict the use of USB CDC-ACM devices, especially in critical systems, to minimize exposure. 3) Configure ModemManager or similar services to limit automatic opening of /dev/ttyACM* devices where possible, or implement stricter device authorization policies to prevent unauthorized USB device connections. 4) Employ USB device whitelisting or endpoint security solutions that can detect and block malicious or unauthorized USB devices. 5) Monitor system logs for unusual activity related to /dev/ttyACM* device openings or kernel errors that could indicate exploitation attempts. 6) For environments where physical security is a concern, enforce strict access controls to prevent unauthorized USB device connections. 7) Consider disabling unused USB interfaces or drivers on Linux systems to reduce the attack surface. These steps go beyond generic patching advice by focusing on controlling device access and monitoring specific kernel interfaces related to the vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-12-29T08:45:45.751Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9834c4522896dcbe987b

Added to database: 5/21/2025, 9:09:08 AM

Last enriched: 6/30/2025, 5:55:28 PM

Last updated: 8/5/2025, 6:50:20 PM

Views: 12

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats