CyberSecBulletin
CVE-2025-21704NVD status: Modified

Linux: Out-of-bounds Write

CVE-2025-21704 is a high-severity out-of-bounds write vulnerability in Linux, with a CVSS 3.1 base score of 7.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. The record lists versions a4e1ae5c0533964170197e4fb4f33bc8c1db5cd2, 90dd2f1b7342b9a671a5ea4160f408037b92b118, 871619c2b78fdfe05afb4e8ba548678687beb812 as the first without the flaw, so updating Linux to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.37% chance of exploitation within 30 days, which is low compared with other CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Linux to a4e1ae5c0533964170197e4fb4f33bc8c1db5cd2 or 90dd2f1b7342b9a671a5ea4160f408037b92b118 or 871619c2b78fdfe05afb4e8ba548678687beb812 or 7828e9363ac4d23b02419bf2a45b9f1d9fb35646, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 5.4.291 or 5.10.235 or 5.15.179 or 6.1.129, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinux1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, a4e1ae5c0533964170197e4fb4f33bc8c1db5cd2; 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, 90dd2f1b7342b9a671a5ea4160f408037b92b118; 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, 871619c2b78fdfe05afb4e8ba548678687beb812; 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, 7828e9363ac4d23b02419bf2a45b9f1d9fb35646; 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, 6abb510251e75f875797d8983a830e6731fa281c; 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, f64079bef6a8a7823358c3f352ea29a617844636; 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, 383d516a0ebc8641372b521c8cb717f0f1834831; 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, e563b01208f4d1f609bcab13333b6c0e24ce6a01; and 1 more rangesa4e1ae5c0533964170197e4fb4f33bc8c1db5cd2, 90dd2f1b7342b9a671a5ea4160f408037b92b118, 871619c2b78fdfe05afb4e8ba548678687beb812, 7828e9363ac4d23b02419bf2a45b9f1d9fb35646, 6abb510251e75f875797d8983a830e6731fa281c, f64079bef6a8a7823358c3f352ea29a617844636
SiemensSIMATIC S7-1500 TM MFP - GNU/Linux subsystemall versionsNot stated
LinuxLinux Kernel2.6.13 up to, but not including, 5.4.291; 5.5 up to, but not including, 5.10.235; 5.11 up to, but not including, 5.15.179; 5.16 up to, but not including, 6.1.129; 6.2 up to, but not including, 6.6.79; 6.7 up to, but not including, 6.12.16; 6.13 up to, but not including, 6.13.4; 2.6.12; and 1 more ranges5.4.291, 5.10.235, 5.15.179, 6.1.129, 6.6.79, 6.12.16

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
LocalThe attacker needs local access or must trick a user into running something.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
LowA basic user account is enough.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.

Official 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.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Out-of-bounds Write

The product writes data past the end, or before the beginning, of the intended buffer.

How developers prevent this class of flaw

  • Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages, such as Ada and C#, typically provide overflow protection, but the protection can be disabled by the programmer. Be wary that a language's interface to native code may still be subject to overflows, even if the language itself is theoretically safe.
  • Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. Examples include the Safe C String Library (SafeStr) by Messier and Viega, and the Strsafe.h library from Microsoft. These libraries provide safer versions of overflow-prone string-handling functions.
  • Use automatic buffer overflow detection mechanisms that are offered by certain compilers or compiler extensions. Examples include: the Microsoft Visual Studio /GS flag, Fedora/Red Hat FORTIFY_SOURCE GCC flag, StackGuard, and ProPolice, which provide various mechanisms including canary-based detection and range/index checking. D3-SFCV (Stack Frame Canary Validation) from D3FEND discusses canary-based detection in detail.

More Out-of-bounds Write vulnerabilities (CWE-787)

Timeline

  1. CVE record published.
  2. Record last changed materially (score, affected products, status or references).

References

Technical write-ups (may include proof of concept)

Recent Out-of-bounds Write vulnerabilities

Spotted an error? Tell us.