9.8 CVE-2024-38541

Buffer Overflow Patch
 

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).
https://nvd.nist.gov/vuln/detail/CVE-2024-38541

Categories

CWE-120 : Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
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. This term was frequently used by vulnerability researchers during approximately 1995 to 2005 to differentiate buffer copies without length checks (which had been known about for decades) from other emerging weaknesses that still involved invalid accesses of buffers, as vulnerability researchers began to develop advanced exploitation techniques. This weakness can be detected using dynamic tools and techniques that interact with the software using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The software's operation may slow down, but it should not become unstable, crash, or generate incorrect results. Manual analysis can be useful for finding this weakness, but it might not achieve desired code coverage within limited time constraints. This becomes difficult for weaknesses that must be considered for all inputs, since the attack surface can be too large. Use tools that are integrated duringcompilation to insert runtime error-checking mechanismsrelated to memory safety errors, such as AddressSanitizer(ASan) for C/C++ [REF-1518]. For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server. Most mitigating technologies at the compiler or OS level to date address only a subset of buffer overflow problems and rarely provide complete protection against even that subset. It is good practice to implement strategies to increase the workload of an attacker, such as leaving the attacker to guess an unknown value that changes every program execution. Replace unbounded copy functions with analogous functions that support length arguments, such as strcpy with strncpy. Create these if they are not available. When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs. Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations. buffer overflow using command with long argument buffer overflow in local program using long environment variable buffer overflow in comment characters, when product increments a counter for a ">" but does not decrement for "<" By replacing a valid cookie value with an extremely long string of characters, an attacker may overflow the application's buffers. By replacing a valid cookie value with an extremely long string of characters, an attacker may overflow the application's buffers.

References


 

CPE

cpe start end
Configuration 1
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* >= 4.14 < 5.4.294
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* >= 5.5 < 5.10.238
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* >= 5.11 < 5.15.182
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* >= 5.16 < 6.1.136
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* >= 6.2 < 6.6.33
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* >= 6.7 < 6.8.12
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* >= 6.9 < 6.9.3


REMEDIATION


Patch

Url
https://git.kernel.org/stable/c/0b0d5701a8bf02f8fee037e81aacf6746558bfd6
https://git.kernel.org/stable/c/46795440ef2b4ac919d09310a69a404c5bc90a88
https://git.kernel.org/stable/c/5d59fd637a8af42b211a92b2edb2474325b4d488
https://git.kernel.org/stable/c/733e62786bdf1b2b9dbb09ba2246313306503414
https://git.kernel.org/stable/c/c7f24b7d94549ff4623e8f41ea4d9f5319bd8ac8
https://git.kernel.org/stable/c/cf7385cb26ac4f0ee6c7385960525ad534323252
https://git.kernel.org/stable/c/e45b69360a63165377b30db4a1dfddd89ca18e9a
https://git.kernel.org/stable/c/ee332023adfd5882808f2dabf037b32d6ce36f9e
https://git.kernel.org/stable/c/0b0d5701a8bf02f8fee037e81aacf6746558bfd6
https://git.kernel.org/stable/c/cf7385cb26ac4f0ee6c7385960525ad534323252
https://git.kernel.org/stable/c/e45b69360a63165377b30db4a1dfddd89ca18e9a
https://git.kernel.org/stable/c/ee332023adfd5882808f2dabf037b32d6ce36f9e


EXPLOITS


Exploit-db.com

id description date
No known exploits

POC Github

Url
No known exploits

Other Nist (github, ...)

Url
No known exploits


CAPEC


Common Attack Pattern Enumerations and Classifications

id description severity
10 Buffer Overflow via Environment Variables
High
100 Overflow Buffers
Very High
14 Client-side Injection-induced Buffer Overflow
High
24 Filter Failure through Buffer Overflow
High
42 MIME Conversion
High
44 Overflow Binary Resource File
Very High
45 Buffer Overflow via Symbolic Links
High
46 Overflow Variables and Tags
High
47 Buffer Overflow via Parameter Expansion
High
67 String Format Overflow in syslog()
Very High
8 Buffer Overflow in an API Call
High
9 Buffer Overflow in Local Command-Line Utilities
High
92 Forced Integer Overflow
High