CyberSecBulletin
CVE-2023-52999NVD status: Analyzed

Linux: Use After Free

CVE-2023-52999 is a high-severity use after free 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 ad0dfe9bcf0d78e699c7efb64c90ed062dc48bea, ddd49cbbd4c1ceb38032018b589b44208e54f55e, d4c008f3b7f7d4ffd311eb2dae5e75b3cbddacd0 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 ad0dfe9bcf0d78e699c7efb64c90ed062dc48bea or ddd49cbbd4c1ceb38032018b589b44208e54f55e or d4c008f3b7f7d4ffd311eb2dae5e75b3cbddacd0 or 66689a72ba73575e76d4f6a8748d3fa2690ec1c4, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 4.19.272 or 5.4.231 or 5.10.166 or 5.15.91, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinux5a2ea549be94924364f6911227d99be86e8cf34a up to, but not including, ad0dfe9bcf0d78e699c7efb64c90ed062dc48bea; 97ad240fd9aa9214497d14af2b91608e20856cac up to, but not including, ddd49cbbd4c1ceb38032018b589b44208e54f55e; c3edc6e808209aa705185f732e682a370981ced1 up to, but not including, d4c008f3b7f7d4ffd311eb2dae5e75b3cbddacd0; a1e18acb0246bfb001b08b8b1b830b5ec92a0f13 up to, but not including, 66689a72ba73575e76d4f6a8748d3fa2690ec1c4; d266935ac43d57586e311a087510fe6a084af742 up to, but not including, 12075708f2e77ee6a9f8bb2cf512c38be3099794; d266935ac43d57586e311a087510fe6a084af742 up to, but not including, 71ab9c3e2253619136c31c89dbb2c69305cc89b1; 4a4df5e78712de39d6f90d6a64b5eb48dca03bd5; 4.19.264 up to, but not including, 4.19.272; and 5 more rangesad0dfe9bcf0d78e699c7efb64c90ed062dc48bea, ddd49cbbd4c1ceb38032018b589b44208e54f55e, d4c008f3b7f7d4ffd311eb2dae5e75b3cbddacd0, 66689a72ba73575e76d4f6a8748d3fa2690ec1c4, 12075708f2e77ee6a9f8bb2cf512c38be3099794, 71ab9c3e2253619136c31c89dbb2c69305cc89b1
LinuxLinux Kernel4.19.264 up to, but not including, 4.19.272; 5.4.223 up to, but not including, 5.4.231; 5.10.153 up to, but not including, 5.10.166; 5.15.77 up to, but not including, 5.15.91; 6.1 up to, but not including, 6.1.9; 6.1 up to, but not including, 6.2; 6.0.7; 6.24.19.272, 5.4.231, 5.10.166, 5.15.91, 6.1.9, 6.2

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 CISA (ADP).

Official description

In the Linux kernel, the following vulnerability has been resolved: net: fix UaF in netns ops registration error path If net_assign_generic() fails, the current error path in ops_init() tries to clear the gen pointer slot. Anyway, in such error path, the gen pointer itself has not been modified yet, and the existing and accessed one is smaller than the accessed index, causing an out-of-bounds error: BUG: KASAN: slab-out-of-bounds in ops_init+0x2de/0x320 Write of size 8 at addr ffff888109124978 by task modprobe/1018 CPU: 2 PID: 1018 Comm: modprobe Not tainted 6.2.0-rc2.mptcp_ae5ac65fbed5+ #1641 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.1-2.fc37 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x6a/0x9f print_address_description.constprop.0+0x86/0x2b5 print_report+0x11b/0x1fb kasan_report+0x87/0xc0 ops_init+0x2de/0x320 register_pernet_operations+0x2e4/0x750 register_pernet_subsys+0x24/0x40 tcf_register_action+0x9f/0x560 do_one_initcall+0xf9/0x570 do_init_module+0x190/0x650 load_module+0x1fa5/0x23c0 __do_sys_finit_module+0x10d/0x1b0 do_syscall_64+0x58/0x80 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f42518f778d Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cb 56 2c 00 f7 d8 64 89 01 48 RSP: 002b:00007fff96869688 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 RAX: ffffffffffffffda RBX: 00005568ef7f7c90 RCX: 00007f42518f778d RDX: 0000000000000000 RSI: 00005568ef41d796 RDI: 0000000000000003 RBP: 00005568ef41d796 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000 R13: 00005568ef7f7d30 R14: 0000000000040000 R15: 0000000000000000 </TASK> This change addresses the issue by skipping the gen pointer de-reference in the mentioned error-path. Found by code inspection and verified with explicit error injection on a kasan-enabled kernel.

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

The underlying weakness: Use After Free

The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory belongs to the code that operates on the new pointer.

How developers prevent this class of flaw

  • Choose a language that provides automatic memory management.
  • When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures may lower the usefulness of this strategy.

More Use After Free vulnerabilities (CWE-416)

Timeline

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

References

Recent Use After Free vulnerabilities

Spotted an error? Tell us.