CVE-2021-20016 — SonicWall SSLVPN SMA100 SQL Injection Vulnerability

CVE-2021-20016

SonicWall SMA100 VPN — Zero-Day SQL Injection in Authentication Flow Enabling Credential Theft and Authentication Bypass; Exploited Before Patch Availability

What is SonicWall SMA100?

SonicWall Secure Mobile Access (SMA) 100 series appliances (SMA 200, SMA 210, SMA 400, SMA 410, SMA 500v) are enterprise SSL VPN gateways that provide remote access to corporate networks for employees and contractors. The SMA 100 series is a dedicated remote access platform — unlike the EOL SRA series — and was actively supported at the time of this vulnerability. Because VPN gateways are internet-facing by design and serve as the entry point to corporate networks, SQL injection vulnerabilities in the authentication layer are particularly severe: they allow credential theft that enables legitimate-looking network access.

Overview

CVE-2021-20016 is an SQL injection vulnerability (CWE-89) in SonicWall SMA 100 series SSL VPN appliances that allows unauthenticated remote attackers to extract VPN user credentials from the appliance's database by exploiting the authentication flow. This was a zero-day: SonicWall announced active exploitation on January 22, 2021 — before a patch was available — and warned customers to restrict SMA 100 access. The patch was released on February 3, 2021. Ransomware operators used credentials obtained via this SQL injection to establish VPN sessions and access corporate networks for ransomware deployment.

Affected Versions

Product Vulnerable Fixed
SMA 200 firmware 10.x before 10.x.0.0-34sv Yes 10.x.0.0-34sv
SMA 210 firmware 10.x before 10.x.0.0-34sv Yes 10.x.0.0-34sv
SMA 400 firmware 10.x before 10.x.0.0-34sv Yes 10.x.0.0-34sv
SMA 410 firmware 10.x before 10.x.0.0-34sv Yes 10.x.0.0-34sv
SMA 500v (virtual appliance) 10.x before 10.x.0.0-34sv Yes 10.x.0.0-34sv

Technical Details

The SMA 100 series authentication flow includes SQL queries that process user-supplied login credentials. These queries are constructed without adequate parameterization:

  • Root cause: SQL injection (CWE-89) — the authentication process incorporates user-supplied input (username, password parameters) into SQL queries without proper parameterization or escaping
  • Credential extraction: By crafting SQL injection payloads in the authentication parameters, an attacker can manipulate the SQL queries to read the VPN user credential database, extracting usernames and password hashes (or potentially plaintext credentials depending on storage method)
  • Authentication bypass: The SQL injection can also potentially bypass the authentication check itself by manipulating the query result to always evaluate as successful
  • No authentication required: The SQL injection is exploitable in the pre-authentication login flow
  • Credential use: Stolen VPN credentials are used to establish legitimate VPN sessions, providing network access that appears as authorized user activity in logs

Discovery

Discovered through active exploitation observed by SonicWall PSIRT. SonicWall announced the zero-day exploitation on January 22, 2021 before a patch was ready, urging customers to implement immediate mitigations. SonicWall characterized the exploitation as "an imminent ransomware campaign using stolen VPN credentials."

Exploitation Context

SonicWall explicitly warned in January 2021 of "an imminent ransomware campaign using stolen credentials from" the vulnerability. Ransomware groups including RYUK, Conti, and others were confirmed to have exploited SonicWall VPN vulnerabilities for initial network access in 2021. The stolen credentials enable persistent access that is harder to detect than typical malware persistence — attackers log in as legitimate users and use legitimate VPN infrastructure for lateral movement.

Remediation

  1. Apply SonicWall firmware 10.x.0.0-34sv (or later) to all SMA 100 series appliances immediately
  2. Immediately rotate all VPN user credentials — if exploitation occurred before patching, all stored credentials must be treated as compromised
  3. Require multi-factor authentication (MFA) for all VPN access — MFA prevents credential theft from enabling access even if credentials are extracted
  4. Review SMA 100 access logs for suspicious login activity, particularly logins from unusual source IPs or geographies
  5. If SMA 100 was exposed to the internet without MFA before patching, treat all VPN user accounts as potentially compromised and perform a thorough review of VPN session logs
  6. Check Active Directory for new accounts, privilege changes, or lateral movement activity that may have occurred through stolen VPN sessions

Key Details

PropertyValue
CVE ID CVE-2021-20016
Vendor / Product SonicWall — SSLVPN SMA100
NVD Published2021-02-04
NVD Last Modified2025-10-31
CVSS 3.1 Score9.8
CVSS 3.1 VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
SeverityCRITICAL
CWE CWE-89 find similar ↗
CISA KEV Added2021-11-03
CISA KEV Deadline2021-11-17
Known Ransomware Use ⚠️ Yes

CVSS 3.1 Breakdown

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Required Action

CISA BOD 22-01 Deadline: 2021-11-17. Apply updates per vendor instructions.

Timeline

DateEvent
2021-01-22SonicWall discloses active zero-day exploitation of SMA 100 series; warns customers to restrict access
2021-02-03SonicWall releases firmware 10.x.0.0-34sv patching CVE-2021-20016
2021-02-04CVE published; SonicWall PSIRT Advisory SNWLID-2021-0001
2021-11-03Added to CISA Known Exploited Vulnerabilities catalog
2021-11-17CISA BOD 22-01 remediation deadline

References

ResourceType
SonicWall PSIRT Advisory SNWLID-2021-0001 Vendor Advisory
NVD — CVE-2021-20016 Vulnerability Database
CISA KEV Catalog Entry US Government