CVE-2022-48174: There is a stack overflow vulnerability in ash.c:6030 in busybox before 1.35. In the environment...
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.62751%
CWE
Published
8/22/2023
Updated
11/29/2024
KEV Status
No
Technology
-
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The analysis started by fetching content from the BusyBox bug tracker URL provided in the references. This revealed an ASAN stack trace and a patch for the vulnerability (CVE-2022-48174).
- The ASAN trace clearly indicated a
dynamic-stack-buffer-overflow
in theevaluate_string
function inshell/math.c
. It also showed thatevaluate_string
was called byash_arith
inshell/ash.c
at line 6030. - The CVE description explicitly states the vulnerability is in
ash.c:6030
. - The fetched patch content (attachment 9446 from the bug report, corresponding to an early fix attempt bf35d8bd) showed a modification to
evaluate_string
inshell/math.c
. Specifically, it changed thealloca
size fornumstack
. The line removed by this patch,var_or_num_t *const numstack = alloca((expr_len / 2) * sizeof(numstack[0]));
, represents the vulnerable code that inadequately allocated space, leading to the overflow. - A later comment in the bug report mentioned a different commit (
d417193cf
) as the final fix, which further modified the allocation inevaluate_string
toalloca(expr_len * sizeof(numstack[0]))
, confirming the allocation size was the core issue.
Based on this, evaluate_string
is identified as the function containing the direct memory corruption vulnerability (insufficient alloca
). ash_arith
is identified as the function in ash.c
that processes the potentially malicious input (the arithmetic expression from the shell) and calls evaluate_string
, thereby triggering the vulnerability. Both functions would appear in a runtime profile during exploitation.