Security Advisory

CVE-2021-42380: BusyBox awk clrvar Use-After-Free

Last updated:
  • CVE-2021-42380

CVE-2021-42380 is a use-after-free in the clrvar function of the BusyBox awk applet: a crafted awk pattern can crash it and possibly run code. NVD scores it 7.2 for BusyBox 1.28.0 through 1.33.1, fixed in 1.34.0, and a second fix carrying this ID shipped in 1.37.0. Siemens lists it for SCALANCE, RUGGEDCOM and SINAMICS GH180 devices.

Vulnerability summary

CVSS base score

7.2

High severity

EPSS score (FIRST)

3.1%

Probability of exploitation in the wild in the next 30 days

CISA KEV catalog

No

Not listed

Published

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

Affected components

ComponentCPEVersion range
BusyBox (awk applet, clrvar / evaluate)cpe:2.3:a:busybox:busybox:*:*:*:*:*:*:*:*1.28.0 through 1.33.1 (NVD CPE); fixed in 1.34.0; follow-up commit 5dcc443 "awk: fix use-after-realloc (CVE-2021-42380)" listed in the 1.37.0 change log
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)—drives produced between Oct 2021 and May 2023 with an S615; update the S615 to V7.2 (Siemens ProductCERT SSA-942865, CISA ICSA-23-166-12)

What does this mean for affected devices?

CVE-2021-42380 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 clrvar 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.28.0 through 1.33.1 as affected (NVD).

Claroty's Team82 and JFrog published it on 9 November 2021 as one of 14 BusyBox CVEs fixed in BusyBox 1.34.0 (19 August 2021). The JFrog post lists awk 1.28 to 1.33.1 and scores it 6.6; the Claroty write-up says the awk bugs apply "if the attacker can supply an arbitrary pattern to awk".

The CVE ID came back later. BusyBox commit 5dcc443 by Denys Vlasenko, dated 2023-05-26, is titled "awk: fix use-after-realloc (CVE-2021-42380), closes 15601". It changes fsrealloc and evaluate in editors/awk.c and adds a test for the program $5=$$5=$0. The line is in the BusyBox 1.37.0 change log on the BusyBox news page, released 27 September 2024. Because 1.36.1 shipped on 19 May 2023, every release from 1.34.0 through 1.36.1 lacks that commit, while NVD's CPE ends at 1.33.1. A scanner that matches on NVD's range alone will not flag those builds. The Debian Security Tracker marks bookworm (1:1.35.0-4+deb12u1) and trixie (1:1.37.0-6) as fixed and bullseye through DLA-4019-1.

Siemens names the devices in three advisories. 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 before V7.2. SSA-565386 lists the SCALANCE W-700 IEEE 802.11ax devices before V2.0. SSA-942865 lists SINAMICS PERFECT HARMONY GH180 drives with an integrated S615, produced between October 2021 and May 2023. Siemens scores the CVE 6.6 (AV:N/AC:H/PR:H).

Our BusyBox vulnerabilities in embedded Linux firmware guide quotes the 1.37.0 change-log line and explains how to check whether awk is compiled in and fed untrusted programs. Related awk pages from the same disclosure are CVE-2021-42378 and CVE-2021-42386.

CVE-2021-42380 is not in the CISA KEV catalog as of 2026-11-17 (catalog version 2026.11.13), and FIRST EPSS gives it 0.0309, the 88th percentile, in the 2026-11-16 dataset (CISA KEV, FIRST EPSS).

To fix it, update the Siemens devices to the versions above. In your own firmware, ship BusyBox 1.37.0 or later, or backport 5dcc443 onto a 1.34.0 to 1.36.1 tree, or remove awk if nothing needs it. Our memory corruption fix guide covers use-after-free as a 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 clrvar; 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.28.0 through 1.33.1. — NVD
  • awk 1.28 to 1.33.1 affected; JFrog score 6.6; all 14 fixed in 1.34.0. — JFrog
  • Commit 5dcc443 (2023-05-26) "awk: fix use-after-realloc (CVE-2021-42380), closes 15601" changes fsrealloc and evaluate in editors/awk.c. — BusyBox commit 5dcc443 (GitHub mirror)
  • BusyBox 1.37.0 (27 September 2024) change log lists "awk: fix use-after-realloc (CVE-2021-42380), closes 15601"; 1.36.1 released 19 May 2023. — BusyBox news
  • bookworm 1:1.35.0-4+deb12u1 and trixie 1:1.37.0-6 fixed; bullseye fixed via DLA-4019-1. — Debian Security Tracker
  • RUGGEDCOM RM1224 and SCALANCE M-800/S615 before V7.2 affected; Siemens CVSS 6.6. — Siemens ProductCERT SSA-419740
  • SINAMICS PERFECT HARMONY GH180 with integrated S615 affected; update S615 to V7.2. — Siemens ProductCERT SSA-942865
  • Not in the CISA KEV catalog as of 2026-11-17 (catalog version 2026.11.13). — CISA KEV
  • EPSS 0.03087 (88th percentile), dataset 2026-11-16, read 2026-11-17. — FIRST EPSS

Related advisories

Sources

  1. NVD
  2. Siemens ProductCERT SSA-419740: Third-Party Component Vulnerabilities in RUGGEDCOM and SCALANCE Products before V7.2
  3. CISA ICS Advisory ICSA-23-075-01
  4. Siemens ProductCERT SSA-565386: Third-Party Component Vulnerabilities in SCALANCE W-700 IEEE 802.11ax devices before V2.0
  5. Siemens ProductCERT SSA-942865: Integrated SCALANCE S615 of SINAMICS Medium Voltage Products
  6. BusyBox commit 5dcc443 (GitHub mirror)
  7. BusyBox news: 1.37.0 change log
  8. JFrog: Unboxing BusyBox, 14 new vulnerabilities
  9. Claroty Team82: Unboxing BusyBox, 14 vulnerabilities
  10. Debian Security Tracker
  11. CISA KEV
  12. FIRST EPSS

Frequently asked questions

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

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 S615 integrated in SINAMICS PERFECT HARMONY GH180 drives (SSA-942865) (per Siemens ProductCERT).

Is BusyBox 1.34.0 enough to fix CVE-2021-42380?

It carries the 2021 fix, but BusyBox later added commit 5dcc443, titled "awk: fix use-after-realloc (CVE-2021-42380)", which first shipped in 1.37.0. Releases 1.34.0 to 1.36.1 lack it (per the BusyBox commit and the busybox.net change log).

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

A way to supply an arbitrary awk program or pattern to BusyBox awk, which is why NVD and Siemens both use high privileges in their vectors (per Claroty Team82, NVD and Siemens ProductCERT).

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

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