CVE-2021-42342 is a remote code execution flaw in the Embedthis GoAhead embedded web server, versions 4.x and 5.x before 5.1.5: form fields sent in a file upload reach CGI programs as unprefixed environment variables, so an attacker can set LD_PRELOAD. NVD scores it 9.8; it is outside the CISA KEV catalog as of 2026-11-17.
Vulnerability summary
CVSS base score
9.8
Critical severity
EPSS score (FIRST)
59.5%
Probability of exploitation in the wild in the next 30 days
CISA KEV catalog
No
Not listed
Published
Vulnerability ID: CVE-2021-42342 · Source: NVD
Affected components
| Component | CPE | Version range |
|---|---|---|
| Embedthis GoAhead | cpe:2.3:a:embedthis:goahead:*:*:*:*:*:*:*:* | 4.0.0 through 4.1.3, and 5.0.0 before 5.1.5 (NVD); fixed in 5.1.5 |
What does this mean for affected devices?
CVE-2021-42342 sits in GoAhead's file upload filter. NVD's description says that in GoAhead 4.x and 5.x before 5.1.5, "user form variables can be passed to CGI scripts without being prefixed with the CGI prefix", which "permits tunneling untrusted environment variables into vulnerable CGI scripts". NVD scores it 9.8 with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H and lists GoAhead 4.0.0 through 4.1.3 and 5.0.0 before 5.1.5 as affected (NVD).
SonicWall Capture Labs' analysis, published 2022-02-04, explains the mechanism and calls it "an incomplete fix for CVE-2017-17562". Variables from multipart/form-data processing are added with websSetVar(), which "does not prefix the variable name", while the variable blacklist in cgiHandler() never matches because of a null argument to strim(). An attacker posts LD_PRELOAD pointing at a shared object, either sent after the form data and read back through the CGI standard input under /proc or /dev, or uploaded as a file and referenced by its temporary name. SonicWall lists the conditions: GoAhead built with ME_GOAHEAD_UPLOAD and ME_GOAHEAD_CGI, a route that handles CGI, and a loader that honours LD_PRELOAD.
The device angle is the server itself. The GoAhead README says it is "easy to embed in your products" and "used in millions of devices worldwide", and its deployment notes state that "CGI, JavaScript templates, uploads and Digest authentication are on by default", which are the two features this flaw needs. No vendor or CERT advisory we checked on 2026-11-17 names a specific device for this CVE, so finding it means finding GoAhead 4.x or 5.x inside a vendor binary. Our embedded web server vulnerabilities guide shows how to search a firmware image for GoAhead strings and which CGI routes to list.
The CVE is not in the CISA KEV catalog as of 2026-11-17 (catalog version 2026.11.13). FIRST EPSS gives it 0.5946, the 99.1st percentile, in the 2026-11-16 dataset, and public proof-of-concept code exists, so treat an exposed GoAhead 4.x or 5.x with CGI enabled as urgent (CISA KEV, FIRST EPSS).
GoAhead's security policy states that fixes ship in the current release only, with no backports, so a device on 4.x or 5.x moves to the current line or carries its own patch. Where the product does not need CGI or uploads, build with ME_GOAHEAD_CGI or ME_GOAHEAD_UPLOAD set to 0, remove unused CGI programs, and keep the web interface off untrusted networks. The predecessor flaw is CVE-2017-17562, which is in the KEV catalog, and our command injection fix guide covers the same request-to-process class in vendor CGI code.
Evidence
- GoAhead 4.x and 5.x before 5.1.5: upload filter passes form variables to CGI without the CGI prefix; NVD CVSS v3.1 9.8 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H); CPE ranges 4.0.0-4.1.3 and 5.0.0 to before 5.1.5. — NVD
- websSetVar() adds multipart variables without prefix; cgiHandler() blacklist fails via strim() null set; incomplete fix for CVE-2017-17562; LD_PRELOAD via /proc or /dev stdin or uploaded temp file; needs ME_GOAHEAD_UPLOAD and ME_GOAHEAD_CGI; published 2022-02-04. — SonicWall Capture Labs
- GoAhead is "used in millions of devices worldwide". — Embedthis GoAhead README
- CGI, JavaScript templates, uploads and Digest authentication are on by default; ME_GOAHEAD_CGI / ME_GOAHEAD_UPLOAD = 0 removes them. — Embedthis GoAhead deployment notes
- Security fixes are delivered in the current release only; no backports. — Embedthis GoAhead security policy
- Not in the CISA KEV catalog as of 2026-11-17 (catalog version 2026.11.13). — CISA KEV
- EPSS 0.5946 (99.1st percentile), dataset 2026-11-16, read 2026-11-17. — FIRST EPSS

Related advisories
Sources
Frequently asked questions
What does an attacker need to exploit CVE-2021-42342?
Network access to a GoAhead 4.x or 5.x server before 5.1.5 that was built with upload and CGI support, a route that runs CGI programs, and a dynamic loader that honours LD_PRELOAD. No login is needed (per NVD and SonicWall Capture Labs).
How is CVE-2021-42342 related to CVE-2017-17562?
SonicWall calls it an incomplete fix for CVE-2017-17562: the earlier fix prefixed request parameters before they became CGI environment variables, but variables added by the upload filter skipped that prefix, so LD_PRELOAD could again reach the CGI process (per SonicWall Capture Labs).
Which devices are affected by CVE-2021-42342?
Any product that embeds GoAhead 4.0.0 to 4.1.3 or 5.0.0 to 5.1.4 with CGI and uploads compiled in. GoAhead says it is used in millions of devices, but no vendor or CERT advisory we checked on 2026-11-17 names a specific product, so check the firmware for the GoAhead version (per NVD and the GoAhead README).
Is CVE-2021-42342 known to be exploited?
It is not in the CISA KEV catalog as of 2026-11-17 (catalog version 2026.11.13). FIRST EPSS gives it 0.5946, the 99.1st percentile, in the 2026-11-16 dataset (per CISA KEV and FIRST EPSS).
Questions about this page?