CyberSecBulletin
CVE-2023-52452NVD status: Modified

Linux: Improper Initialization

CVE-2023-52452 is a high-severity improper initialization 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 bf32eaf5093dc1c24ccc26b14c3422f6dfcc5236, 0954982db8283016bf38e9db2da5adf47a102e19, fbcf372c8eda2290470268e0afb5ab5d5f5d5fde 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.24% 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 bf32eaf5093dc1c24ccc26b14c3422f6dfcc5236 or 0954982db8283016bf38e9db2da5adf47a102e19 or fbcf372c8eda2290470268e0afb5ab5d5f5d5fde or 6b4a64bafd107e521c01eec3453ce94a3fb38529, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 6.6.14 or 6.7.2, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinux01f810ace9ed37255f27608a0864abebccf0aab3 up to, but not including, bf32eaf5093dc1c24ccc26b14c3422f6dfcc5236; 01f810ace9ed37255f27608a0864abebccf0aab3 up to, but not including, 0954982db8283016bf38e9db2da5adf47a102e19; 01f810ace9ed37255f27608a0864abebccf0aab3 up to, but not including, fbcf372c8eda2290470268e0afb5ab5d5f5d5fde; 01f810ace9ed37255f27608a0864abebccf0aab3 up to, but not including, 6b4a64bafd107e521c01eec3453ce94a3fb38529; f3c4b01689d392373301e6e60d1b02c5b4020afc; d1b725ea5d104caea250427899f4e2e3ab15b4fc; 5.10.33 up to, but not including, 5.11; 5.11.17 up to, but not including, 5.12; and 1 more rangesbf32eaf5093dc1c24ccc26b14c3422f6dfcc5236, 0954982db8283016bf38e9db2da5adf47a102e19, fbcf372c8eda2290470268e0afb5ab5d5f5d5fde, 6b4a64bafd107e521c01eec3453ce94a3fb38529, 5.11, 5.12
LinuxLinux Kernel5.12 up to, but not including, 6.6.14; 6.7.0 up to, but not including, 6.7.26.6.14, 6.7.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 NVD.

Official description

In the Linux kernel, the following vulnerability has been resolved: bpf: Fix accesses to uninit stack slots Privileged programs are supposed to be able to read uninitialized stack memory (ever since 6715df8d5) but, before this patch, these accesses were permitted inconsistently. In particular, accesses were permitted above state->allocated_stack, but not below it. In other words, if the stack was already "large enough", the access was permitted, but otherwise the access was rejected instead of being allowed to "grow the stack". This undesired rejection was happening in two places: - in check_stack_slot_within_bounds() - in check_stack_range_initialized() This patch arranges for these accesses to be permitted. A bunch of tests that were relying on the old rejection had to change; all of them were changed to add also run unprivileged, in which case the old behavior persists. One tests couldn't be updated - global_func16 - because it can't run unprivileged for other reasons. This patch also fixes the tracking of the stack size for variable-offset reads. This second fix is bundled in the same commit as the first one because they're inter-related. Before this patch, writes to the stack using registers containing a variable offset (as opposed to registers with fixed, known values) were not properly contributing to the function's needed stack size. As a result, it was possible for a program to verify, but then to attempt to read out-of-bounds data at runtime because a too small stack had been allocated for it. Each function tracks the size of the stack it needs in bpf_subprog_info.stack_depth, which is maintained by update_stack_depth(). For regular memory accesses, check_mem_access() was calling update_state_depth() but it was passing in only the fixed part of the offset register, ignoring the variable offset. This was incorrect; the minimum possible value of that register should be used instead. This tracking is now fixed by centralizing the tracking of stack size in grow_stack_state(), and by lifting the calls to grow_stack_state() to check_stack_access_within_bounds() as suggested by Andrii. The code is now simpler and more convincingly tracks the correct maximum stack size. check_stack_range_initialized() can now rely on enough stack having been allocated for the access; this helps with the fix for the first issue. A few tests were changed to also check the stack depth computation. The one that fails without this patch is verifier_var_off:stack_write_priv_vs_unpriv.

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

The underlying weakness: Improper Initialization

The product does not initialize or incorrectly initializes a resource.

How developers prevent this class of flaw

  • Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, in Java, if the programmer does not explicitly initialize a variable, then the code could produce a compile-time error (if the variable is local) or automatically initialize the variable to the default value for the variable's type. In Perl, if explicit initialization is not performed, then a default value of undef is assigned, which is interpreted as 0, false, or an equivalent value depending on the context in which the variable is accessed.
  • Identify all variables and data stores that receive information from external sources, and apply input validation to make sure that they are only initialized to expected values.
  • Explicitly initialize all your variables and other data stores, either during declaration or just before the first usage.

More Improper Initialization vulnerabilities (CWE-665)

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 Initialization vulnerabilities

Spotted an error? Tell us.