Linux: Improper Validation of Array Index
CVE-2023-52604 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 e3e95c6850661c77e6dab079d9b5374a618ebb15, 98f9537fe61b8382b3cc5dd97347531698517c56, de34de6e57bbbc868e4fcf9e98c76b3587cabb0b 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.
High severity with no evidence of exploitation so far.
What to do
- Update Linux to e3e95c6850661c77e6dab079d9b5374a618ebb15 or 98f9537fe61b8382b3cc5dd97347531698517c56 or de34de6e57bbbc868e4fcf9e98c76b3587cabb0b or 6fe8b702125aeee6ce83f20092a2341446704e7b, whichever matches your release line, or a later version.
- Update Linux Kernel to 4.19.307 or 5.4.269 or 5.10.210 or 5.15.149, whichever matches your release line, or a later version.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Linux | Linux | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, e3e95c6850661c77e6dab079d9b5374a618ebb15; 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, 98f9537fe61b8382b3cc5dd97347531698517c56; 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, de34de6e57bbbc868e4fcf9e98c76b3587cabb0b; 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, 6fe8b702125aeee6ce83f20092a2341446704e7b; 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, 42f433785f108893de0dd5260bafb85d7d51db03; 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, 6a44065dd604972ec1fbcccbdc4a70d266a89cdd; 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, 59342822276f753e49d27ef5eebffbba990572b9; 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 up to, but not including, 9862ec7ac1cbc6eb5ee4a045b5d5b8edbb2f7e68; and 1 more ranges | e3e95c6850661c77e6dab079d9b5374a618ebb15, 98f9537fe61b8382b3cc5dd97347531698517c56, de34de6e57bbbc868e4fcf9e98c76b3587cabb0b, 6fe8b702125aeee6ce83f20092a2341446704e7b, 42f433785f108893de0dd5260bafb85d7d51db03, 6a44065dd604972ec1fbcccbdc4a70d266a89cdd |
| Linux | Linux Kernel | before 4.19.307; 4.20 up to, but not including, 5.4.269; 5.5 up to, but not including, 5.10.210; 5.11 up to, but not including, 5.15.149; 5.16 up to, but not including, 6.1.77; 6.2 up to, but not including, 6.6.16; 6.7 up to, but not including, 6.7.4 | 4.19.307, 5.4.269, 5.10.210, 5.15.149, 6.1.77, 6.6.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.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 7.8 | High | CNA |
| CVSS 3.1 | 7.8 | High | NVD |
Official description
In the Linux kernel, the following vulnerability has been resolved: FS:JFS:UBSAN:array-index-out-of-bounds in dbAdjTree Syzkaller reported the following issue: UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dmap.c:2867:6 index 196694 is out of range for type 's8[1365]' (aka 'signed char[1365]') CPU: 1 PID: 109 Comm: jfsCommit Not tainted 6.6.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 ubsan_epilogue lib/ubsan.c:217 [inline] __ubsan_handle_out_of_bounds+0x11c/0x150 lib/ubsan.c:348 dbAdjTree+0x474/0x4f0 fs/jfs/jfs_dmap.c:2867 dbJoin+0x210/0x2d0 fs/jfs/jfs_dmap.c:2834 dbFreeBits+0x4eb/0xda0 fs/jfs/jfs_dmap.c:2331 dbFreeDmap fs/jfs/jfs_dmap.c:2080 [inline] dbFree+0x343/0x650 fs/jfs/jfs_dmap.c:402 txFreeMap+0x798/0xd50 fs/jfs/jfs_txnmgr.c:2534 txUpdateMap+0x342/0x9e0 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline] jfs_lazycommit+0x47a/0xb70 fs/jfs/jfs_txnmgr.c:2732 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 </TASK> ================================================================================ Kernel panic - not syncing: UBSAN: panic_on_warn set ... CPU: 1 PID: 109 Comm: jfsCommit Not tainted 6.6.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 panic+0x30f/0x770 kernel/panic.c:340 check_panic_on_warn+0x82/0xa0 kernel/panic.c:236 ubsan_epilogue lib/ubsan.c:223 [inline] __ubsan_handle_out_of_bounds+0x13c/0x150 lib/ubsan.c:348 dbAdjTree+0x474/0x4f0 fs/jfs/jfs_dmap.c:2867 dbJoin+0x210/0x2d0 fs/jfs/jfs_dmap.c:2834 dbFreeBits+0x4eb/0xda0 fs/jfs/jfs_dmap.c:2331 dbFreeDmap fs/jfs/jfs_dmap.c:2080 [inline] dbFree+0x343/0x650 fs/jfs/jfs_dmap.c:402 txFreeMap+0x798/0xd50 fs/jfs/jfs_txnmgr.c:2534 txUpdateMap+0x342/0x9e0 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline] jfs_lazycommit+0x47a/0xb70 fs/jfs/jfs_txnmgr.c:2732 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 </TASK> Kernel Offset: disabled Rebooting in 86400 seconds.. The issue is caused when the value of lp becomes greater than CTLTREESIZE which is the max size of stree. Adding a simple check solves this issue. Dave: As the function returns a void, good error handling would require a more intrusive code reorganization, so I modified Osama's patch at use WARN_ON_ONCE for lack of a cleaner option. The patch is tested via syzbot.
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
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- git.kernel.org/stable/c/42f433785f108893de0dd5260bafb85d7d51db03
- git.kernel.org/stable/c/59342822276f753e49d27ef5eebffbba990572b9
- git.kernel.org/stable/c/6a44065dd604972ec1fbcccbdc4a70d266a89cdd
- git.kernel.org/stable/c/6fe8b702125aeee6ce83f20092a2341446704e7b
- git.kernel.org/stable/c/9862ec7ac1cbc6eb5ee4a045b5d5b8edbb2f7e68
- git.kernel.org/stable/c/98f9537fe61b8382b3cc5dd97347531698517c56
- git.kernel.org/stable/c/de34de6e57bbbc868e4fcf9e98c76b3587cabb0b
- git.kernel.org/stable/c/e3e95c6850661c77e6dab079d9b5374a618ebb15
- lists.debian.org/debian-lts-announce/2024/06/msg00017.html
- lists.debian.org/debian-lts-announce/2024/06/msg00020.html
Recent Improper Validation of Array Index vulnerabilities
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 9.8 Critical severity
Spotted an error? Tell us.