Security Advisory

CVE-2021-42386: BusyBox awk nvalloc Use-After-Free

Last updated:
  • CVE-2021-42386

CVE-2021-42386 is a use-after-free in the nvalloc function of the BusyBox awk applet: a crafted awk pattern can crash it and possibly run code. NVD scores it 7.2. It is one of 14 BusyBox bugs that Claroty and JFrog reported, fixed in 1.34.0. Siemens lists it for SCALANCE and RUGGEDCOM industrial routers before V7.2.

Vulnerability summary

CVSS base score

7.2

High severity

EPSS score (FIRST)

2.8%

Probability of exploitation in the wild in the next 30 days

CISA KEV catalog

No

Not listed

Published

Vulnerability ID: CVE-2021-42386 · Source: NVD

Affected components

ComponentCPEVersion range
BusyBox (awk applet, nvalloc)cpe:2.3:a:busybox:busybox:*:*:*:*:*:*:*:*1.16.0 through 1.33.1 (NVD CPE); fixed in 1.34.0 (19 August 2021)
Siemens RUGGEDCOM RM1224 and SCALANCE M-800 / S615 routers (M804PB, M812-1, M816-1, M826-2, M874-x, M876-x, MUM853-1, MUM856-1, S615, S615 EEC)—before V7.2; fixed in V7.2 (Siemens ProductCERT SSA-419740, CISA ICSA-23-075-01)
Siemens SCALANCE W-700 IEEE 802.11ax (WAM763-1, WAM766-1, WUM763-1, WUM766-1)—before V2.0; fixed in V2.0 (Siemens ProductCERT SSA-565386, CISA ICSA-23-080-07)
Siemens SINAMICS PERFECT HARMONY GH180 (integrated SCALANCE S615)—integrated S615 before V7.2; update the S615 to V7.2 (Siemens ProductCERT SSA-942865, CISA ICSA-23-166-12)

What does this mean for affected devices?

CVE-2021-42386 is a use-after-free (CWE-416) in BusyBox's awk applet. NVD's description says it "leads to denial of service and possibly code execution when processing a crafted awk pattern in the nvalloc function". NVD scores it 7.2 (high), vector CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H, and lists BusyBox 1.16.0 through 1.33.1 as affected (NVD).

It is one of 14 CVEs that Claroty's Team82 and JFrog published on 9 November 2021. Their write-up says all were fixed in BusyBox 1.34.0, released 19 August 2021, and states the condition for this one: it "applies if the attacker can supply an arbitrary pattern to awk". It also notes that awk is built by the default BusyBox configuration. In JFrog's set of more than 10,000 public embedded firmware images, 40% contained a BusyBox binary linked with one of the affected applets. Claroty's page scores this CVE 6.6, below NVD's 7.2.

Siemens confirms the device impact in three advisories, each republished by CISA. SSA-419740 (2023-03-14, CISA ICSA-23-075-01) lists the RUGGEDCOM RM1224 LTE(4G) and the SCALANCE M804PB, M812-1, M816-1, M826-2, M874-2, M874-3, M876-3, M876-4, MUM853-1, MUM856-1, S615 and S615 EEC, with the fix in V7.2. SSA-565386 (2023-03-14, CISA ICSA-23-080-07) lists the SCALANCE W-700 IEEE 802.11ax access points and clients (WAM763-1, WAM766-1, WUM763-1, WUM766-1) before V2.0. SSA-942865 (2023-06-13, CISA ICSA-23-166-12) covers the SCALANCE S615 built into SINAMICS PERFECT HARMONY GH180 medium-voltage drives. For those drives Siemens recommends updating the S615 to V7.2, restricting physical access to the drive's front Ethernet port, and removing any direct network connection to the S615. Siemens scores the CVE 6.6, vector AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H.

The high-privilege requirement in every score is the key to triage: an attacker has to get an awk program of their choice run on the device. On a router that means an authenticated management path or a script that turns received data into awk code. Our BusyBox vulnerabilities in embedded Linux firmware guide uses this CVE range in its worked example and shows how to tell whether awk is compiled in and reachable. Its newer relative CVE-2023-42363 shows the same applet keeps producing memory-safety bugs.

CVE-2021-42386 is not in the CISA KEV catalog as of 2026-11-16 (catalog version 2026.11.13), and FIRST EPSS gives it 0.0276, the 86th percentile, in the 2026-11-15 dataset (CISA KEV, FIRST EPSS).

To fix it, update Siemens devices to the versions above. In your own firmware, ship BusyBox 1.34.0 or later, or remove awk if no script needs it. The Debian Security Tracker shows the backport route: bullseye was fixed in 1:1.30.1-6+deb11u1 (DLA-4019-1). Our memory corruption fix guide covers the weakness class.

How to fix this class of issueThis advisory's weakness class is Memory corruption. Our practical guide covers how to detect, fix, verify and disclose it: How to fix memory corruption in embedded firmware.

Evidence

  • Use-after-free in awk nvalloc with a crafted awk pattern; NVD CVSS 3.1 7.2 (AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H), CWE-416; CPE 1.16.0 through 1.33.1. — NVD
  • 14 BusyBox CVEs fixed in 1.34.0 (19 August 2021); CVE-2021-42386 applies if the attacker can supply an arbitrary awk pattern; awk is in the default config; 40% of 10,000+ firmware images linked an affected applet; CVSS v3 6.6. — Claroty Team82
  • RUGGEDCOM RM1224 and SCALANCE M-800/S615 devices affected before V7.2; Siemens CVSS 6.6 (AV:N/AC:H/PR:H). — Siemens ProductCERT SSA-419740 (CISA ICSA-23-075-01)
  • SCALANCE W-700 IEEE 802.11ax (WAM763-1, WAM766-1, WUM763-1, WUM766-1) affected before V2.0. — Siemens ProductCERT SSA-565386 (CISA ICSA-23-080-07)
  • SINAMICS PERFECT HARMONY GH180 integrated SCALANCE S615 affected; update S615 to V7.2, restrict physical access, disconnect direct network connections to the S615. — Siemens ProductCERT SSA-942865 (CISA ICSA-23-166-12)
  • Bullseye fixed in 1:1.30.1-6+deb11u1 (DLA-4019-1); unstable fixed in 1:1.35.0-1. — Debian Security Tracker
  • Not in the CISA KEV catalog as of 2026-11-16 (catalog version 2026.11.13). — CISA KEV
  • EPSS 0.02756 (86th percentile), dataset 2026-11-15, read 2026-11-16. — FIRST EPSS

Related advisories

Sources

  1. NVD
  2. Claroty Team82: Unboxing BusyBox, 14 vulnerabilities uncovered by Claroty, JFrog
  3. Siemens ProductCERT SSA-419740: RUGGEDCOM and SCALANCE products before V7.2
  4. Siemens ProductCERT SSA-565386: SCALANCE W-700 IEEE 802.11ax before V2.0
  5. Siemens ProductCERT SSA-942865: integrated SCALANCE S615 of SINAMICS medium-voltage products
  6. CISA ICS Advisory ICSA-23-075-01
  7. Debian Security Tracker
  8. CISA KEV
  9. FIRST EPSS

Frequently asked questions

Which Siemens products are affected by CVE-2021-42386?

RUGGEDCOM RM1224 and SCALANCE M-800 and S615 routers before V7.2 (SSA-419740), SCALANCE W-700 IEEE 802.11ax devices before V2.0 (SSA-565386), and the SCALANCE S615 integrated in SINAMICS PERFECT HARMONY GH180 drives (SSA-942865) (per Siemens ProductCERT).

What does an attacker need to exploit CVE-2021-42386?

The ability to supply an arbitrary awk pattern to BusyBox awk. That is why NVD and Siemens both require high privileges in their CVSS vectors (per Claroty Team82, NVD and Siemens ProductCERT).

Which BusyBox version fixes CVE-2021-42386?

BusyBox 1.34.0, released 19 August 2021. NVD lists 1.16.0 through 1.33.1 as affected, and Debian backported the fix to bullseye in 1:1.30.1-6+deb11u1 (per Claroty Team82, NVD and the Debian Security Tracker).

Is CVE-2021-42386 in the CISA KEV catalog?

No, not as of 2026-11-16 (catalog version 2026.11.13). FIRST EPSS gives it 0.0276, the 86th percentile, in the 2026-11-15 dataset (per CISA KEV and FIRST EPSS).