Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-58251 Overview
CVE-2024-58251 affects the netstat applet in BusyBox versions through 1.37.0. The vulnerability allows local users to launch a network application with an argv[0] value containing ANSI terminal escape sequences. When a victim later runs netstat, the embedded escape sequences render on the terminal and can lock it up, producing a denial of service condition.
The weakness is categorized as [CWE-150], improper neutralization of escape, meta, or control sequences. BusyBox is widely deployed on embedded Linux systems, routers, and container base images, which broadens the exposure surface despite the low severity rating.
Critical Impact
A local user can poison netstat output with terminal escape sequences, causing the victim's terminal session to lock up when netstat is invoked.
Affected Products
- BusyBox versions up to and including 1.37.0
- The netstat applet component within BusyBox
- Embedded Linux distributions and container images bundling vulnerable BusyBox builds
Discovery Timeline
- 2025-04-23 - CVE-2024-58251 published to NVD and discussed on the OpenWall oss-security mailing list
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-58251
Vulnerability Analysis
The BusyBox netstat applet reads process information from /proc to display program names associated with network sockets. The applet writes the process argv[0] string directly to the terminal without stripping or neutralizing non-printable characters.
A local user who launches a process with an argv[0] crafted to include ANSI escape sequences can inject those sequences into any subsequent netstat output viewed by another user. The attack requires only unprivileged local access and the ability to spawn a process with a controlled argument vector.
Impact is limited to terminal integrity. The injected escape sequences can clear the screen, reposition the cursor, alter colors, or send control codes that lock the terminal, forcing the victim to kill the session. Confidentiality and integrity of system data are not affected, which aligns with the low-severity classification.
Root Cause
The root cause is missing output sanitization in the netstat applet when printing untrusted process metadata. BusyBox trusts the contents of /proc/<pid>/cmdline and emits raw bytes to the terminal. This matches the [CWE-150] pattern of failing to neutralize escape sequences in output destined for a terminal interpreter.
Attack Vector
The attack is local and requires user interaction. An attacker with a shell on the target host launches a program whose argv[0] contains ANSI control bytes, for example by using exec -a or a small wrapper that calls execve with an attacker-controlled argument array. When an administrator or another user runs busybox netstat, the terminal processes the injected sequences and may become unresponsive.
No code examples are reproduced here. See the BusyBox Bug Report #15922 and the OpenWall OSS-Security Discussion for the referenced technical details.
Detection Methods for CVE-2024-58251
Indicators of Compromise
- Process entries in /proc/<pid>/cmdline that contain the 0x1B (ESC) byte or other C0 control characters in argv[0].
- Unexpected terminal state changes, screen clears, or hung shell sessions immediately following execution of netstat.
- Shell history entries invoking exec -a with non-printable arguments or scripts that call execve with crafted argument vectors.
Detection Strategies
- Audit running processes for control characters in command-line arguments using grep -P "[\\x00-\\x08\\x0E-\\x1F\\x7F]" /proc/*/cmdline.
- Enable Linux auditd rules on execve syscalls and inspect the a0 argument field for escape bytes.
- Correlate low-privilege process launches with subsequent administrator sessions that run netstat.
Monitoring Recommendations
- Alert on new processes whose command-line arguments contain non-printable bytes outside tab, newline, and carriage return.
- Monitor BusyBox versions deployed across endpoints and containers to track exposure to CVE-2024-58251.
- Review shell session recordings for abrupt terminal resets after invocation of networking utilities.
How to Mitigate CVE-2024-58251
Immediate Actions Required
- Inventory systems running BusyBox 1.37.0 or earlier, including embedded devices and container images.
- Restrict shell access on multi-user systems where administrators run netstat interactively.
- Prefer the full iproute2 tools (ss, ip) over busybox netstat on hosts where sanitized output is required.
Patch Information
At the time of publication, no fixed BusyBox release was referenced in the NVD entry. Monitor the BusyBox Downloads Section and the upstream BusyBox Official Website for a release containing a fix for the netstat output sanitization issue tracked in BusyBox Bug Report #15922.
Workarounds
- Pipe netstat output through a filter that strips control characters, for example busybox netstat -tnp | cat -v or | tr -d '\033'.
- Replace calls to busybox netstat with ss from iproute2, which does not emit raw argv[0] bytes to the terminal.
- Configure terminal emulators to disable interpretation of unsafe escape sequences where supported.
- Limit who can execute arbitrary binaries on shared hosts by applying stricter noexec mount options or AppArmor and SELinux profiles.
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

