CriticalCVE-2021-20038

    SonicWall SMA 100 Appliances Stack-Based Buffer Overflow Vulnerability (CVE-2021-20038)

    Published In CISA KEV since Sources: CVE.org

    What is affected, what to do

    An unauthenticated attacker can execute code on SonicWall SMA 100 devices due to a stack-based buffer overflow in the mod_cgi module of the SMA100 Apache httpd server. This affects firmware versions 10.2.0.8-37sv, 10.2.1.1-19sv, 10.2.1.2-24sv, and earlier. The vulnerability is actively exploited in ransomware campaigns. Affected products include SMA 200, 210, 400, 410, and 500v appliances. Immediate patching to the latest firmware version is critical.

    The vulnerability is being actively exploited; treat it as a priority. CISA lists it as used in ransomware campaigns. The available sources name no fixed version. Check the vendor guidance in the references below. Immediate actions, mitigation and detection rules are in the runbook below.

    Affected
    • SonicWall SMA100 eq 10.2.0.8-37sv and earlier..10.2.0.8-37sv and earlier
    • SonicWall SMA100 eq 10.2.1.1-19sv and earlier..10.2.1.1-19sv and earlier
    • SonicWall SMA100 eq 10.2.1.2-24sv and earlier..10.2.1.2-24sv and earlier

    Not sure whether and how you are affected? Ask a question about this vulnerability

    Metrics

    9.8

    Priority

    XIEM Effective CVSS: highest available CVSS rating from NVD and vendor data.

    Source: NVD, CVSS v3

    9.8

    CVSS v3

    Severity Critical on the scale from 0 to 10.

    Source: CVE.org

    99.91 %

    EPSS score

    High — model estimates ≥ 50% chance of real-world exploitation within 30 days.

    Source: FIRST EPSS, percentile 99.97

    Show all metrics
    Severity
    Critical
    Priority (0–325)

    The priority score is a consolidated metric that condenses several individual signals into a single, action-guiding ranking: technical severity (CVSS), exploitation likelihood (EPSS), known-exploited status (KEV) and the context of the affected asset. The aim is to answer the only truly important question in vulnerability management: what first?

    Read in glossary
    254.12 Methodology
    Exploit maturity

    An exploit is code or a technique that specifically uses a concrete vulnerability to force unintended behaviour — such as executing code or escalating privileges. It is the tool that turns a theoretical flaw into a practical attack.

    Read in glossary
    actively exploited
    XIEM Effective CVSS

    XIEM® is the tiered managed-security operating model from NEOSEC and a registered trademark of NEOSEC GmbH. It extends classic SIEM — the central collection, normalisation and correlation of security-relevant events — with endpoint forensics, network visibility and deception technology, and consolidates them into three building tiers: Sentry, Orchestrate and Command.

    Read in glossary
    9.8 Methodology
    CVSS v3

    CVSS is the globally established, open standard for assessing the technical severity of a vulnerability on a scale from 0 to 10. It describes how easily a flaw can be exploited and what damage it can cause — but not how likely its actual exploitation is. CVSS and the complementary EPSS deliberately answer different questions.

    Read in glossary
    9.8
    EPSS score

    The EPSS score is the absolute model output for an individual vulnerability: the estimated probability of real-world exploitation within the next 30 days, expressed as a value between 0 and 1 (i.e. 0 % to 100 %). A score of 0.42 means „the model estimates a 42 % chance of real-world exploitation within 30 days“.

    Read in glossary
    99.91 %
    High — model estimates ≥ 50% chance of real-world exploitation within 30 days.
    EPSS percentile

    The EPSS percentile is the relative position of a vulnerability within all EPSS-scored CVEs, expressed as a value between 0 and 1. A percentile of 0.90 means „this CVE has a higher EPSS score than 90 % of all other scored CVEs“. Unlike the EPSS score, it is not a probability — but a positioning within a ranking.

    Read in glossary
    99.97
    Critical — this CVE ranks in the top fifth of all CVEs scored today (rank ≥ 80%).
    KEV status

    The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.

    Read in glossary
    Actively exploited
    Published
    In CISA KEV since

    The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.

    Read in glossary
    CWE

    CWE is a catalogue of typical weakness types in software and hardware — such as flawed input validation, unsafe memory handling or poor authentication. Where a CVE names a concrete vulnerability in a concrete product, a CWE describes the underlying class of defect.

    Read in glossary
    CWE-121

    Response and mitigation

    Why act now?

    Prioritisation rationale

    This flaw is network-reachable without authentication or user interaction. It sits on a perimeter device that is internet-facing by design and brokers credentials into the internal network. Public exploit code exists, the exploitation likelihood is among the very highest of any CVE, and CISA flags known use in ransomware campaigns. In those campaigns SMA 100 units serve as the initial foothold before credential theft and encryption. Treat any internet-exposed, unpatched SMA 100 as a critical emergency with a patch window measured in hours, and assume it is compromised until forensics shows otherwise.

    1. Runbook step 1

      Immediate response (0-24 h)

      • Inventory: Locate every SonicWall SMA 200, 210, 400, 410 and 500v and confirm its firmware in the admin UI. Vulnerable releases are 10.2.0.8-37sv, 10.2.1.1-19sv, 10.2.1.2-24sv and earlier.
      • Patch: A firmware fix is available from the vendor. Look up the fixed release in the SonicWall PSIRT advisory. Retire or disconnect older 9.x and EOL units that cannot receive the fix.
      • Cut exposure now: If you cannot patch within hours, restrict the portal and management interface (typically TCP/443, or your custom HTTPS port) to known source ranges on the upstream firewall. If necessary, take the appliance offline temporarily.
      • Check for compromise before patching: Preserve the config, logs and active session list as a forensic copy. Patching does not evict persistence an attacker has already planted.
      • Rotate credentials: If the device was exposed while unpatched, reset local SMA accounts, admin passwords, LDAP/AD bind service accounts and the passwords of VPN users who authenticated through the portal. Enforce MFA on the SMA.
      • Escalate: Assess the incident against your NIS2 reporting obligations. If you find indicators of compromise, the early warning to BSI or your national CSIRT is due within 24 h.
    2. Runbook step 2

      Mitigation layers

      • Network segmentation: Place the SMA in a dedicated DMZ. Allow egress only to defined internal targets (AD, file servers, published hosts). Block and log internet-bound egress from the appliance, which would carry reverse shells or tool downloads.
      • WAF/IPS: Deploy an upstream rule that drops requests to /cgi-bin/ with oversized query strings or headers. The exploit depends on very long environment-variable content, and a length cap of a few hundred bytes will not break legitimate portal traffic. Enable vendor signatures for CVE-2021-20038 in your Suricata/Snort or NGFW IPS feeds.
      • Rate limiting: Public exploits brute-force ASLR with many repeated requests. Per-source request throttling on the SMA portal raises the cost of exploitation substantially.
      • IAM / least privilege: Limit the SMA's LDAP bind account to read-only, and never use a Domain Admin for it. Trim the resources reachable through the SMA to what users actually need.
      • Configuration: Disable admin access on the WAN interface and turn off unused portal features. Forward syslog to an external SIEM, because local logs on a compromised box cannot be trusted.
    3. Runbook step 3

      Detection rules

      • Web / reverse-proxy logs: Hunt for /cgi-bin/ requests with abnormally long URIs. Example SPL: index=proxy dest=<sma_ip> uri_path="/cgi-bin/*" | where len(uri_query)>500 | stats count by src_ip. Also look for high request bursts from a single source.
      • Appliance stability: Repeated httpd crashes or restarts and 5xx spikes in SMA syslog are the footprint of ASLR brute-forcing. Turn this into a Sigma threshold rule on httpd restart events per 10 min.
      • Network telemetry (Zeek/Suricata): Alert on new outbound connections from the SMA IP to the internet, especially on odd ports or with interactive-session patterns. An example is conn.log where id.orig_h == <sma_ip> and the external destination is not on the allowlist.
      • Lateral movement: Review logons sourced from the SMA IP or its VPN address pool against internal hosts (Windows EID 4624 logon type 3/10, bursts of EID 4625). Also look for unusual LDAP queries by the bind account and off-hours VPN sessions.
      • Integrity: Diff the exported config against a known-good baseline. New local users, altered bookmarks, unknown admin sessions or scripts in writable paths (running as nobody) all indicate compromise.

    Detection rules

    No NEOSEC detection rule is available for this vulnerability yet.

    Classification under NIS2 and CRA

    Rule-based classification from exploitation status and severity. It does not replace a case-by-case assessment.

    NIS2

    NIS2 is EU Directive (EU) 2022/2555 to raise the level of cybersecurity across the Union. It substantially broadens obligations compared with the first NIS directive: more sectors, mandatory risk management, staged reporting duties and personal accountability of senior management.

    Read in glossary
    Actively exploited: treat the vulnerability as a priority in vulnerability handling under Art. 21(2)(e) NIS2. If it is exploited in your environment, check the reporting obligation under Art. 23 (early warning within 24 hours).
    CRA

    The CRA is EU Regulation (EU) 2024/2847 setting horizontal cybersecurity requirements for „products with digital elements“ — from industrial controllers and software to connected consumer devices. For the first time manufacturers must ensure security across the entire product lifecycle, handle vulnerabilities and provide security updates.

    Read in glossary
    Since 11.09.2026, manufacturers of affected products with digital elements must report actively exploited vulnerabilities under Art. 14 CRA, with an early warning within 24 hours via ENISA's single reporting platform.
    ISO/IEC 27001

    ISO/IEC 27001 is the internationally leading standard for an information security management system (ISMS). It describes a risk-based, process-oriented framework to systematically plan, implement, review and improve information security.

    Read in glossary
    Control A.8.8, management of technical vulnerabilities: assess relevance to your systems, plan remediation and keep evidence.

    Description

    A Stack-based buffer overflow vulnerability in SMA100 Apache httpd server's mod_cgi module environment variables allows a remote unauthenticated attacker to potentially execute code as a 'nobody' user in the appliance. This vulnerability affected SMA 200, 210, 400, 410 and 500v appliances firmware 10.2.0.8-37sv, 10.2.1.1-19sv, 10.2.1.2-24sv and earlier versions.

    Source: NVD (NIST), cvelistv5, CISA KEV Catalog

    Affected products

    The following versions are affected. Older releases of the same product line are also vulnerable unless stated otherwise.

    Affected products
    Affected versionsFixed in
    SonicWallSonicWall SMA100
    • 10.2.1.1-19sv and earlier
    • 10.2.0.8-37sv and earlier
    • 10.2.1.2-24sv and earlier
    • —
    • —
    • —

    Vendors and products

    Affected operating systems

    Affected operating systems
    Othersonicwallsma_200_firmware10.2.0.8-37sv
    Othersonicwallsma_200_firmware10.2.1.1-19sv
    Othersonicwallsma_200_firmware10.2.1.2-24sv
    Othersonicwallsma_210_firmware10.2.0.8-37sv
    Othersonicwallsma_210_firmware10.2.1.1-19sv
    Othersonicwallsma_210_firmware10.2.1.2-24sv
    Othersonicwallsma_400_firmware10.2.0.8-37sv
    Othersonicwallsma_400_firmware10.2.1.1-19sv
    Othersonicwallsma_400_firmware10.2.1.2-24sv
    Othersonicwallsma_410_firmware10.2.0.8-37sv
    Othersonicwallsma_410_firmware10.2.1.1-19sv
    Othersonicwallsma_410_firmware10.2.1.2-24sv
    Othersonicwallsma_500v_firmware10.2.0.8-37sv
    Othersonicwallsma_500v_firmware10.2.1.1-19sv
    Othersonicwallsma_500v_firmware10.2.1.2-24sv

    Weakness classes (CWE)

    • CWE-121Stack-based Buffer Overflow

      Variant

      A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function).

      Entry at MITRE CWE-121

    Public exploit references

    Publicly reported proof-of-concepts, exploit modules and detection templates for this vulnerability. NEOSEC links to the original sources only and does not provide any exploit code.

    Public exploit references
    CISA KEV CatalogCISA Known Exploited Vulnerability (opens in a new tab)cisa.govactively exploited
    Reference tagged as exploitgithub.com (opens in a new tab)PoC (publicly reported)reported, not verified—
    Reference tagged as exploitrapid7.com (opens in a new tab)PoC (publicly reported)reported, not verified—

    References & sources

    • psirt.global.sonicwall.comvuln-detail/SNWLID-2021-0026x_refsource_CONFIRM, Vendor advisory
    • github.comjbaines-r7/badbloodx_refsource_MISC, Exploit, Third-party advisory
    • rapid7.comblog/post/2022/01/11/cve-2021-20038-42-sonicwall-sma-100-multip…x_refsource_MISC, Exploit, Third-party advisory
    • cisa.govknown-exploited-vulnerabilities-catalog?field_cve=CVE-2021-20038government-resource, US government resource
    Embed badge

    Show the severity and KEV status of this vulnerability on your site – with a link back here. The image is updated hourly.

    Badge preview for CVE-2021-20038
    <a href="https://intel.neosec.eu/en/cve/CVE-2021-20038"><img src="https://intel.neosec.eu/badge/cve/CVE-2021-20038.svg?lang=en" alt="CVE-2021-20038 – NEOSEC Intel" height="20"></a>