Skip to main content
Mallory
CriticalExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2021-20016: Unauthenticated SQL Injection in SonicWall SMA 100 SSL VPN

Published Feb 3, 2021 · Updated 1 month ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS9.8Critical · v3.1
EPSS40.0%99th percentile
CISA KEVYesAdded Nov 3, 2021
In the wildActivePer CISA KEV
Vendor
Sonicwall
IdentifiersCVE-2021-20016CWE-89 · Improper Neutralization of Special…

CVE-2021-20016 is a SQL injection vulnerability affecting SonicWall Secure Mobile Access (SMA) 100 Series SSL VPN appliances running vulnerable 10.x firmware builds. Improper neutralization of SQL input allows a remote, unauthenticated attacker to submit a specially crafted query and retrieve usernames, passwords, and session-related information. The vulnerability was exploited as a zero-day in January 2021 and patched in February 2021.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

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

Successful exploitation exposes VPN login credentials and session information, compromising the confidentiality of authentication data. Attackers have used the vulnerability for initial access in intrusions that subsequently deployed FiveHands and DarkSide ransomware. Those downstream compromises involved additional attacker activity; arbitrary code execution and ransomware deployment are not established as direct effects of the SQL injection. Evidence that an attacker used the vulnerability to disable VPN multifactor authentication remains unconfirmed.

Mitigation

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

Monitor for compromised VPN credentials and enforce multifactor authentication with strong passwords to reduce credential-abuse risk. These measures do not correct the SQL injection or prevent disclosure of session information and are not substitutes for installing fixed firmware.

Remediation

Patch, then assume compromise.

Install SonicWall firmware containing the fix released in February 2021, or a later supported release containing that fix. The original minimum fixed build is not specified. For broader SMA 100 appliance security hardening, firmware version 10.2.1.7 or later adds file integrity monitoring and anomalous process identification.

Public exploits

Exploits

1 exploit validated by Mallory's analysis.

View more in app →
sonicwall-audit-toolkitRepository 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.anir0y · Disclosed Feb 23, 2026 · python · c · network · local (docker lab)Weaponized
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 100 Firmwareoperating_system
SonicwallSma 200 Firmwareoperating_system
SonicwallSma 210 Firmwareoperating_system
SonicwallSma 400 Firmwareoperating_system
SonicwallSma 410 Firmwareoperating_system
SonicwallSma 500vapplication
FAQ

Frequently asked questions

Is CVE-2021-20016 exploited in the wild?
Yes. As of Oct 16, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Nov 3, 2021.
Is there a public exploit for CVE-2021-20016?
Yes. Mallory tracks 1 public exploit or proof of concept for CVE-2021-20016, the earliest disclosed Feb 23, 2026.
Is there a patch for CVE-2021-20016?
Install SonicWall firmware containing the fix released in February 2021, or a later supported release containing that fix. The original minimum fixed build is not specified.
What products are affected by CVE-2021-20016?
Sonicwall Sma 100 Firmware, Sonicwall Sma 200 Firmware, Sonicwall Sma 210 Firmware, Sonicwall Sma 400 Firmware, Sonicwall Sma 410 Firmware, and 1 more.
How severe is CVE-2021-20016?
CVE-2021-20016 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 40.0% (99th percentile) as of Oct 16, 2026.
Mallory platform

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, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidence4Every report linking this CVE to a named adversary.
Associated malware9Malware families linked to this CVE, with evidence and IOCs.
Detection signatures4YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity9Community discussion across Reddit, Mastodon, and other social sources.