CVE-2021-20038..42: SonicWall SMA 100 Multiple Vulnerabilities (FIXED)
Five vulnerabilities were found in SonicWall SMA 100 series devices, including a stack-based buffer overflow that can lead to unauthenticated remote code execution. An attacker could exploit these issues to take control of the device, inject commands, traverse paths, cause CPU exhaustion, or use the device as a proxy.
rapid7.com
Published on rapid7.com
Over the course of routine security research, Rapid7 researcher Jake Baines discovered and reported five vulnerabilities involving the SonicWall Secure Mobile Access (SMA) 100 series of devices, which includes SMA 200, 210, 400, 410, and 500v. The most serious of these issues can lead to unauthenticated remote code…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely multiple root causes: a stack buffer overflow from unchecked string concatenation, command injection due to missing newline filtering, path traversal from unvalidated input, an infinite loop from improper argument parsing, and a confused deputy due to missing authentication and authorization checks.
Impact
The buffer overflow could allow unauthenticated attackers to gain complete control of the device, while the other vulnerabilities could lead to command execution with root privileges, file write, denial of service, or use of the device as a proxy to internal networks, though some require authentication or have limitations such as blind exploitation.
What the attacker needed
Unauthenticated for CVE-2021-20038, 20040, 20041, 20042; authenticated admin for CVE-2021-20039; network access to the device
The fix
The vulnerabilities were fixed by applying vendor-supplied updates.
How it was found
- Send a crafted HTTP request with an overly long QUERY_STRING to the web server to trigger the buffer overflow.
- Log in to the web interface to obtain a session cookie.
- Send a request to the viewcert endpoint with a CERT parameter containing a newline and a command to execute.
- Send a request to the sonicfiles endpoint with RacNumber=43 and a swcctn parameter containing path traversal to write a file.
- Send a request to the sonicfiles endpoint with RacNumber=25 and a crafted Arg2 parameter to trigger an infinite loop.
- Send a request to the sonicfiles endpoint with RacNumber=25 and an SMB URL to make the device connect to an arbitrary host.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
This report describes several security flaws in a remote access device. The worst flaw lets an attacker run their own code on the device without logging in, which could give them full control. Other flaws let logged-in users run commands, write files outside intended folders, crash the device, or use it to reach other systems.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.