CyberSecBulletin
CVE-2023-52835NVD status: Analyzed

Linux: Improper Validation of Array Index

CVE-2023-52835 is a high-severity improper validation of array index 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 8c504f615d7ed60ae035c51d0c789137ced6797f, 788c0b3442ead737008934947730a6d1ff703734, 1a2a4202c60fcdffbf04f259002ce9bff39edece 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.25% 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 8c504f615d7ed60ae035c51d0c789137ced6797f or 788c0b3442ead737008934947730a6d1ff703734 or 1a2a4202c60fcdffbf04f259002ce9bff39edece or fd0df3f8719201dbe61a4d39083d5aecd705399a, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 4.19.300 or 5.4.262 or 5.10.202 or 5.15.140, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinux45bfb2e50471abbbfd83d40d28c986078b0d24ff up to, but not including, 8c504f615d7ed60ae035c51d0c789137ced6797f; 45bfb2e50471abbbfd83d40d28c986078b0d24ff up to, but not including, 788c0b3442ead737008934947730a6d1ff703734; 45bfb2e50471abbbfd83d40d28c986078b0d24ff up to, but not including, 1a2a4202c60fcdffbf04f259002ce9bff39edece; 45bfb2e50471abbbfd83d40d28c986078b0d24ff up to, but not including, fd0df3f8719201dbe61a4d39083d5aecd705399a; 45bfb2e50471abbbfd83d40d28c986078b0d24ff up to, but not including, 9ce4e87a8efd37c85766ec08b15e885cab08553a; 45bfb2e50471abbbfd83d40d28c986078b0d24ff up to, but not including, 2424410f94a94d91230ced094062d859714c984a; 45bfb2e50471abbbfd83d40d28c986078b0d24ff up to, but not including, 2e905e608e38cf7f8dcddcf8a6036e91a78444cb; 45bfb2e50471abbbfd83d40d28c986078b0d24ff up to, but not including, 54aee5f15b83437f23b2b2469bcf21bdd9823916; and 1 more ranges8c504f615d7ed60ae035c51d0c789137ced6797f, 788c0b3442ead737008934947730a6d1ff703734, 1a2a4202c60fcdffbf04f259002ce9bff39edece, fd0df3f8719201dbe61a4d39083d5aecd705399a, 9ce4e87a8efd37c85766ec08b15e885cab08553a, 2424410f94a94d91230ced094062d859714c984a
LinuxLinux Kernelbefore 4.19.300; 4.20 up to, but not including, 5.4.262; 5.5 up to, but not including, 5.10.202; 5.11 up to, but not including, 5.15.140; 5.16 up to, but not including, 6.1.64; 6.2 up to, but not including, 6.5.13; 6.6 up to, but not including, 6.6.34.19.300, 5.4.262, 5.10.202, 5.15.140, 6.1.64, 6.5.13

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: perf/core: Bail out early if the request AUX area is out of bound When perf-record with a large AUX area, e.g 4GB, it fails with: #perf record -C 0 -m ,4G -e arm_spe_0// -- sleep 1 failed to mmap with 12 (Cannot allocate memory) and it reveals a WARNING with __alloc_pages(): ------------[ cut here ]------------ WARNING: CPU: 44 PID: 17573 at mm/page_alloc.c:5568 __alloc_pages+0x1ec/0x248 Call trace: __alloc_pages+0x1ec/0x248 __kmalloc_large_node+0xc0/0x1f8 __kmalloc_node+0x134/0x1e8 rb_alloc_aux+0xe0/0x298 perf_mmap+0x440/0x660 mmap_region+0x308/0x8a8 do_mmap+0x3c0/0x528 vm_mmap_pgoff+0xf4/0x1b8 ksys_mmap_pgoff+0x18c/0x218 __arm64_sys_mmap+0x38/0x58 invoke_syscall+0x50/0x128 el0_svc_common.constprop.0+0x58/0x188 do_el0_svc+0x34/0x50 el0_svc+0x34/0x108 el0t_64_sync_handler+0xb8/0xc0 el0t_64_sync+0x1a4/0x1a8 'rb->aux_pages' allocated by kcalloc() is a pointer array which is used to maintains AUX trace pages. The allocated page for this array is physically contiguous (and virtually contiguous) with an order of 0..MAX_ORDER. If the size of pointer array crosses the limitation set by MAX_ORDER, it reveals a WARNING. So bail out early with -ENOMEM if the request AUX area is out of bound, e.g.: #perf record -C 0 -m ,4G -e arm_spe_0// -- sleep 1 failed to mmap with 12 (Cannot allocate memory)

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

The underlying weakness: Improper Validation of Array Index

The product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array.

How developers prevent this class of flaw

  • Use an input validation framework such as Struts or the OWASP ESAPI Validation API. Note that using a framework does not automatically address all input validation problems; be mindful of weaknesses that could arise from misusing the framework itself (CWE-1173).
  • Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, Ada allows the programmer to constrain the values of a variable and languages such as Java and Ruby will allow the programmer to handle exceptions when an out-of-bounds index is accessed.
  • Use a CPU and operating system that offers Data Execution Protection (using hardware NX or XD bits) or the equivalent techniques that simulate this feature in software, such as PaX. These techniques ensure that any instruction executed is exclusively at a memory address that is part of the code segment. For more information on these techniques see D3-PSEP (Process Segment Execution Prevention) from D3FEND.

More Improper Validation of Array Index vulnerabilities (CWE-129)

Timeline

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

References

Recent Improper Validation of Array Index vulnerabilities

Spotted an error? Tell us.