Skip to main content
Mallory
CriticalExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2024-40766: Improper Access Control in SonicWall SonicOS Management and SSL VPN

Published Aug 23, 2024 · Updated 2 days ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 days8 mentions · peak 2 in a dayToday
CVSS9.8Critical · v3.1
EPSS1.8%80th percentile
CISA KEVYesAdded Sep 9, 2024
In the wildActivePer CISA KEV
Vendor
Sonicwall
IdentifiersCVE-2024-40766CWE-284 · Improper Access Control
Also known assnwlid_2024_0015

CVE-2024-40766 is an improper access control vulnerability in the management access and SSL VPN functionality of SonicWall SonicOS. It affects specified Generation 5 and Generation 6 firewalls and Generation 7 firewalls running SonicOS 7.0.1-5035 or earlier. A remote attacker can obtain unauthorized access to resources and, under certain conditions, cause the firewall to crash. Exploitation can compromise confidentiality and integrity, bypass security policies, and disrupt availability. The vulnerability has been exploited for initial access in ransomware operations, including activity associated with Akira and SafePay. Detailed vulnerable functions and triggering request structures are not publicly established in the available information.

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 can expose protected resources and potentially allow unauthorized viewing, modification, or deletion of data. A firewall crash can cause denial of service and interrupt connectivity or security services. Unauthorized SSL VPN access can provide a foothold into internal networks, enabling subsequent credential theft, lateral movement, data exfiltration, and ransomware deployment. These downstream activities require additional attacker actions and should not be interpreted as evidence that this vulnerability directly provides arbitrary code execution.

Mitigation

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

Disable internet-facing WAN management or restrict management access to trusted sources. Disable SSL VPN where unnecessary; otherwise restrict it to trusted source addresses and enforce MFA for all SSL VPN users. Remove inactive accounts, minimize account privileges, and monitor authentication logs, configuration changes, and unusual network traffic. Segment remote-access networks from sensitive systems. These measures reduce exposure but do not replace firmware updates, credential resets, or replacement of unsupported appliances.

Remediation

Patch, then assume compromise.

Install the model-specific fixed SonicOS firmware identified in SonicWall advisory SNWLID-2024-0015, preferably upgrading to a current supported release. Patches were released in August 2024. Immediately reset passwords for locally managed SSL VPN accounts, particularly on Generation 5 and Generation 6 devices, and require password changes for affected local accounts. Reset all user passwords when addressing related compromise risk, including credentials retained during Generation 6-to-Generation 7 migrations; firmware upgrades alone do not invalidate previously compromised credentials. Replace end-of-support Generation 6 and 6.5 devices with supported appliances rather than relying indefinitely on historical patches.

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
SonicwallSonicosoperating_system
FAQ

Frequently asked questions

Is CVE-2024-40766 exploited in the wild?
Yes. As of Nov 26, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Sep 9, 2024.
Is there a public exploit for CVE-2024-40766?
Yes. Mallory tracks 1 public exploit or proof of concept for CVE-2024-40766, the earliest disclosed Feb 23, 2026.
Is there a patch for CVE-2024-40766?
Install the model-specific fixed SonicOS firmware identified in SonicWall advisory SNWLID-2024-0015, preferably upgrading to a current supported release. Patches were released in August 2024.
What products are affected by CVE-2024-40766?
Sonicwall Sonicos.
How severe is CVE-2024-40766?
CVE-2024-40766 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 1.8% (80th percentile) as of Nov 26, 2026.
Activity feed

Recent activity

233 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
heiseNews · Nov 20, 2026SonicWall rät Kunden zum Entsorgen von Gen6-Firewalls | heise onlineA critical vulnerability rated CVSS 9.3 affecting SonicWall Gen5, Gen6, and early Gen7 firewalls. The article cites its exploitation and subsequent hotfixes as a historical example of the risks facing unsupported devices; it does not describe the technical flaw.Read more ↗sonicwallNews · Nov 18, 2026Product Advisory: Retire Unsupported Gen 6 FirewallsA critical SonicOS vulnerability with a CVSS score of 9.3 affecting SonicWall Gen 5, Gen 6 and early Gen 7 firewalls. The advisory cites its exploitation as a historical example of firewall risk and mentions accompanying ransomware activity against SSL VPN accounts. Supported firewalls received a fix.Read more ↗zeropath blogNews · Nov 6, 2026Brief Summary: SonicOS CVE-2026-107154 Management Interface Session Validation Flaw (CWE-291) - ZeroPath Blog | ZeroPathA previously disclosed vulnerability referenced as historical context for attacks on SonicWall access infrastructure. The content associates its exploitation with Akira ransomware activity, including likely initial access in a June 2025 incident targeting Nutanix AHV systems. Its technical root cause is not described, and no relationship to CVE-2026-107154 is established.Read more ↗zeropath blogNews · Nov 6, 2026Brief Summary: SonicOS CVE-2026-107155 Permissive Cross-Domain (CORS) Policy in the Management API - ZeroPath Blog | ZeroPathA separate SonicWall firmware vulnerability mentioned as historical background, not as part of the management API vulnerability pair. The article reports significant correlation with 2025 SSLVPN incidents and says Akira affiliates likely abused it alongside stolen credentials. It does not describe the vulnerability's technical root cause.Read more ↗
+81 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
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 evidence42Every report linking this CVE to a named adversary.
Associated malware68Malware families linked to this CVE, with evidence and IOCs.
Detection signatures1YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity109Community discussion across Reddit, Mastodon, and other social sources.