Skip to main content
Mallory
CriticalCISA KEVExploited in the wildPublic exploit

Unauthenticated RCE in SonicWall SMA100 Apache httpd mod_cgi

IdentifiersCVE-2021-20038CWE-121· Stack-based Buffer Overflow

CVE-2021-20038 is a critical stack-based buffer overflow in the Apache httpd server used by SonicWall SMA 100 Series appliances (SMA 200, 210, 400, 410, and 500v). The flaw is in the SSLVPN web server’s handling of CGI environment variables in the mod_cgi code path for HTTP GET requests, where environment-variable data is concatenated into a single stack buffer using strcat without proper bounds checking. A remote unauthenticated attacker can send a crafted request that overflows the stack and potentially achieve code execution as the low-privilege 'nobody' user on the appliance. The issue affects firmware 10.2.0.8-37sv, 10.2.1.1-19sv, 10.2.1.2-24sv, and earlier versions.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation can result in unauthenticated remote code execution on the affected SMA appliance as the 'nobody' user. This gives an attacker the ability to run arbitrary code in the appliance context, establish footholds on the VPN gateway, conduct follow-on reconnaissance, steal data accessible to that context, and potentially use the compromised edge device as an entry point for broader intrusion activity. Because the target is a remote access appliance, compromise can materially affect confidentiality, integrity, and availability of the appliance and connected enterprise environment.

Mitigation

If you can’t patch tonight, do this now.

If immediate patching is not possible, reduce exposure of the SMA management and SSLVPN interfaces to only trusted source networks, minimize internet exposure, and monitor the appliance closely for signs of compromise. Apply compensating controls such as network segmentation, strong authentication/MFA for remote access, and incident-response review of appliance logs and configuration changes. However, the content indicates the vulnerability impacts affected systems even when the web application firewall is enabled, so firmware upgrade is the primary effective mitigation.

Remediation

Patch, then assume compromise.

Upgrade affected SonicWall SMA 100 Series appliances to the vendor-fixed firmware versions referenced in SonicWall advisory #2021-020 / PSIRT SNWLID-2021-0026. The provided patch set addresses CVE-2021-20038 and related SMA100 issues. Systems running firmware 10.2.0.8-37sv, 10.2.1.1-19sv, 10.2.1.2-24sv, and earlier should be updated immediately to the latest supported release available from MySonicWall.
PUBLIC EXPLOITS

Exploits

1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos.

VALID 1 / 1 TOTALView more in app
sonicwall-audit-toolkitMaturityPoCVerified exploit

Repository purpose: a Python-based SonicWall “Security Audit Toolkit” plus a Docker CTF-style lab that simulates and (in solutions) exploits two critical SonicWall CVEs. Top-level structure: - sonicwall_audit.py: main orchestrator CLI that runs modules (ssl, cve, auth, web) against a target https://<host>:<port>, writes JSON/text reports to reports/. - validate_cves.py: standalone deep validators for CVE-2021-20038 and CVE-2024-53704 using non-destructive behavioral checks. - modules/: implementation of auditors/validators and report generation. - lab/: docker-compose lab with two containers: - cve-2021-20038: Apache + deliberately vulnerable 32-bit CGI binary /usr/lib/cgi-bin/sslvpnclient (and symlinks portal/welcome/etc). Protections disabled (no canary, execstack, no PIE, ASLR disabled in entrypoint) to make stack overflow exploitation feasible. - cve-2024-53704: Flask/Gunicorn SSLVPN simulator on 4433 with vulnerable swap cookie deserialization (conditional HMAC verification). - lab/exploits/: skeleton exploit templates (incomplete). - lab/solutions/: working exploits. Exploit capabilities present: 1) CVE-2024-53704 (auth bypass via cookie forgery): Working exploit forges a base64-encoded JSON session cookie named swap with {username, authenticated:true} and omits sig_version so the server skips HMAC verification. It then accesses /virtual-office/ and /dashboard to retrieve the flag. 2) CVE-2021-20038 (stack buffer overflow -> RCE): Working exploit crafts a URL-encoded query string payload to overflow a 4096-byte stack buffer in the CGI handler (strcpy of QUERY_STRING). Payload includes a NOP sled, null-free 32-bit x86 Linux shellcode that runs /bin//sh -c "cat /root/flag.txt", padding to offset 4100, and an attacker-chosen return address into the sled. Output is returned in the HTTP response body. Important distinction: the main toolkit modules and CVE validators are primarily scanners/validators and explicitly avoid destructive exploitation; the actual exploitation code is confined to the lab solution scripts intended for the local practice environment.

anir0yDisclosed Feb 23, 2026pythoncnetworklocal (docker lab)
EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
SonicwallSma 200 Firmwareoperating_system
SonicwallSma 210 Firmwareoperating_system
SonicwallSma 400 Firmwareoperating_system
SonicwallSma 410 Firmwareoperating_system
SonicwallSma 500v Firmwareoperating_system

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence1

Every observed campaign linking this CVE to a named adversary.

Associated malware3

Malware families riding this exploit, with evidence and IOCs.

Detection signatures1

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity1

Community discussion across Reddit, Mastodon, and other social sources.