CyberSecBulletin
CVE-2024-26981NVD status: Modified

Linux: Improper Validation of Array Index

CVE-2024-26981 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 054f29e9ca05be3906544c5f2a2c7321c30a4243, 90f43980ea6be4ad903e389be9a27a2a0018f1c8, 7061c7efbb9e8f11ce92d6b4646405ea2b0b4de1 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.27% 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 054f29e9ca05be3906544c5f2a2c7321c30a4243 or 90f43980ea6be4ad903e389be9a27a2a0018f1c8 or 7061c7efbb9e8f11ce92d6b4646405ea2b0b4de1 or bdbe483da21f852c93b22557b146bc4d989260f0, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 4.19.313 or 5.4.275 or 5.10.216 or 5.15.157, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinux2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, 054f29e9ca05be3906544c5f2a2c7321c30a4243; 2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, 90f43980ea6be4ad903e389be9a27a2a0018f1c8; 2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, 7061c7efbb9e8f11ce92d6b4646405ea2b0b4de1; 2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, bdbe483da21f852c93b22557b146bc4d989260f0; 2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, 897ac5306bbeb83e90c437326f7044c79a17c611; 2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, 2382eae66b196c31893984a538908c3eb7506ff9; 2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, 90823f8d9ecca3d5fa6b102c8e464c62f416975f; 2ba466d74ed74f073257f86e61519cb8f8f46184 up to, but not including, c4a7dc9523b59b3e73fd522c73e95e072f876b16; and 1 more ranges054f29e9ca05be3906544c5f2a2c7321c30a4243, 90f43980ea6be4ad903e389be9a27a2a0018f1c8, 7061c7efbb9e8f11ce92d6b4646405ea2b0b4de1, bdbe483da21f852c93b22557b146bc4d989260f0, 897ac5306bbeb83e90c437326f7044c79a17c611, 2382eae66b196c31893984a538908c3eb7506ff9
LinuxLinux Kernel2.6.30 up to, but not including, 4.19.313; 4.20 up to, but not including, 5.4.275; 5.5 up to, but not including, 5.10.216; 5.11 up to, but not including, 5.15.157; 5.16 up to, but not including, 6.1.88; 6.2 up to, but not including, 6.6.29; 6.7 up to, but not including, 6.8.8; 6.94.19.313, 5.4.275, 5.10.216, 5.15.157, 6.1.88, 6.6.29
DebianDebian Linux10.0Not stated

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: nilfs2: fix OOB in nilfs_set_de_type The size of the nilfs_type_by_mode array in the fs/nilfs2/dir.c file is defined as "S_IFMT >> S_SHIFT", but the nilfs_set_de_type() function, which uses this array, specifies the index to read from the array in the same way as "(mode & S_IFMT) >> S_SHIFT". static void nilfs_set_de_type(struct nilfs_dir_entry *de, struct inode *inode) { umode_t mode = inode->i_mode; de->file_type = nilfs_type_by_mode[(mode & S_IFMT)>>S_SHIFT]; // oob } However, when the index is determined this way, an out-of-bounds (OOB) error occurs by referring to an index that is 1 larger than the array size when the condition "mode & S_IFMT == S_IFMT" is satisfied. Therefore, a patch to resize the nilfs_type_by_mode array should be applied to prevent OOB errors.

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

Third-party and government advisories

Recent Improper Validation of Array Index vulnerabilities

Spotted an error? Tell us.