CyberSecBulletin
CVE-2024-38541NVD status: Modified

Linux: Buffer Copy without Checking Size of Input

CVE-2024-38541 is a high-severity buffer copy without checking size of input 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 46795440ef2b4ac919d09310a69a404c5bc90a88, 733e62786bdf1b2b9dbb09ba2246313306503414, c7f24b7d94549ff4623e8f41ea4d9f5319bd8ac8 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.9% chance of exploitation within 30 days, higher than 60% of scored CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Linux to 46795440ef2b4ac919d09310a69a404c5bc90a88 or 733e62786bdf1b2b9dbb09ba2246313306503414 or c7f24b7d94549ff4623e8f41ea4d9f5319bd8ac8 or 5d59fd637a8af42b211a92b2edb2474325b4d488, whichever matches your release line, or a later version.
  2. Update linux_kernel to 0b0d5701a8bf or ee332023adfd or e45b69360a63 or cf7385cb26ac, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinuxbc575064d688c8933a6ca51429bea9bc63628d3b up to, but not including, 46795440ef2b4ac919d09310a69a404c5bc90a88; bc575064d688c8933a6ca51429bea9bc63628d3b up to, but not including, 733e62786bdf1b2b9dbb09ba2246313306503414; bc575064d688c8933a6ca51429bea9bc63628d3b up to, but not including, c7f24b7d94549ff4623e8f41ea4d9f5319bd8ac8; bc575064d688c8933a6ca51429bea9bc63628d3b up to, but not including, 5d59fd637a8af42b211a92b2edb2474325b4d488; bc575064d688c8933a6ca51429bea9bc63628d3b up to, but not including, 0b0d5701a8bf02f8fee037e81aacf6746558bfd6; bc575064d688c8933a6ca51429bea9bc63628d3b up to, but not including, ee332023adfd5882808f2dabf037b32d6ce36f9e; bc575064d688c8933a6ca51429bea9bc63628d3b up to, but not including, e45b69360a63165377b30db4a1dfddd89ca18e9a; bc575064d688c8933a6ca51429bea9bc63628d3b up to, but not including, cf7385cb26ac4f0ee6c7385960525ad534323252; and 1 more ranges46795440ef2b4ac919d09310a69a404c5bc90a88, 733e62786bdf1b2b9dbb09ba2246313306503414, c7f24b7d94549ff4623e8f41ea4d9f5319bd8ac8, 5d59fd637a8af42b211a92b2edb2474325b4d488, 0b0d5701a8bf02f8fee037e81aacf6746558bfd6, ee332023adfd5882808f2dabf037b32d6ce36f9e
Linuxlinux_kernelbc575064d688 up to, but not including, 0b0d5701a8bf; bc575064d688 up to, but not including, ee332023adfd; bc575064d688 up to, but not including, e45b69360a63; bc575064d688 up to, but not including, cf7385cb26ac; 4.140b0d5701a8bf, ee332023adfd, e45b69360a63, cf7385cb26ac

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

Scoring systemScoreSeverityScored by
CVSS 3.17.8HighCNA
CVSS 3.19.8CriticalCISA (ADP)

Official description

In the Linux kernel, the following vulnerability has been resolved: of: module: add buffer overflow check in of_modalias() In of_modalias(), if the buffer happens to be too small even for the 1st snprintf() call, the len parameter will become negative and str parameter (if not NULL initially) will point beyond the buffer's end. Add the buffer overflow check after the 1st snprintf() call and fix such check after the strlen() call (accounting for the terminating NUL char).

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

The underlying weakness: Buffer Copy without Checking Size of Input

The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output 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 Buffer Copy without Checking Size of Input vulnerabilities (CWE-120)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: yes, technical impact: total).
  3. Record last changed materially (score, affected products, status or references).

References

Recent Buffer Copy without Checking Size of Input vulnerabilities

Spotted an error? Tell us.