Document Title: =============== Fortinet FortiAnalyzer & FortiManager - Client Side Cross Site Scripting Vulnerability References (Source): ==================== http://www.vulnerability-lab.com/get_content.php?id=1354 Security Bulletin FortiGuard: http://www.fortiguard.com/advisory/FG-IR-15-005/ PSIRT ID: 1327458 http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-3620 CVE-ID: ======= CVE-2015-3620 Release Date: ============= 2015-05-05 Vulnerability Laboratory ID (VL-ID): ==================================== 1354 Common Vulnerability Scoring System: ==================================== 3.5 Product & Service Introduction: =============================== FortiAnalyzer Centralized Logging and Reporting Appliances securely aggregate, analyze, and report on network log data gathered from Fortinet Network Security Appliances and other syslog-compatible devices. You can analyze and manage a wide range of data, including security events, network traffic, Web content, and email, to measure your security posture regulatory compliance. FortiAnalyzer is one of several versatile, adaptive Fortinet Network Security Management Products that support diverse deployment types, growth flexibility, advanced customization through APIs and simple licensing. Versatile models are designed for large organizations and multi-tenant environments, smaller networks and mid-enterprise organizations (Copy of the Vendor Homepage: http://www.fortinet.com/products/fortianalyzer/network-security-logging-reporting.html ) The FortiAnalyzer Virtual Security Reporting Appliances securely aggregate log data from Fortinet devices and other syslog-compatible devices. Using a comprehensive suite of easily-customized reports, users can filter and review records, including traffic, event, virus, attack, Web content, and email data, mining the data to determine your security stance and assure regulatory compliance. (Copy of the Vendor Homepage: http://www.fortinet.com/products/fortianalyzer/virtual-security-reporting.html ) Abstract Advisory Information: ============================== The Vulnerability Laboratory Research Team discovered a client-side vulnerability in the Fortinet FortiAnalyzer & FortiManager v5.2 appliance web-application. Vulnerability Disclosure Timeline: ================================== 2014-12-01: Researcher Notification & Coordination (Benjamin Kunz Mejri) 2014-12-02: Vendor Notification 1 (Fortiguard Security - CERT Team) 2015-02-10: Vendor Notification 2 (Fortiguard Security - CERT Team) 2015-02-13: Vendor Response/Feedback (Fortiguard Security - CERT Team) 2015-04-30: Vendor Fix/Patch (Fortinet Developer Team) 2015-05-05: Public Disclosure (Vulnerability Laboratory) Discovery Status: ================= Published Affected Product(s): ==================== Fortinet Product: FortiAnalyzer & FortiManager - Appliance Web Application 5.2 Exploitation Technique: ======================= Remote Severity Level: =============== Medium Technical Details & Description: ================================ A non-persistent input validation web vulnerability has been discovered in the official Fortinet FortiAnalyzer & FortiManager v5.2 appliance web-application. The security vulnerability allows remote attackers to manipulate client-side application to browser requests to compromise user/admin session information. The vulnerability is located in the `query and name` values of the `Reports > Advanced > Dataset > View Dataset` module. Remote attackers are able to inject malicious script codes to client-side application requests. Remote attackers are able to prepare special crafted weblinks to execute client-side script code that compromises the fortinanalyzer user/admin session data. The execution of the script code occurs in the test query display module. The attack vector of the vulnerability is located on the client-side of the online-service and the request method to inject or execute the code is GET. The appliance web-application filter prevents to execute script code tags after the request by the vulnerable inputs. To bypass the validation filter and protection mechanism of the fortinalayzer use the img, embed and iframe tags with onload to inject client-side script code. The problem is that the input filter does not capture the the context with the correct encoding as result the code bypass the filter of the appliance and executes as dom. The security risk of the non-persistent cross site vulnerability is estimated as medium with a cvss (common vulnerability scoring system) count of 3.5. Exploitation of the non-persistent cross site scripting web vulnerability requires no privileged web application user account and low user interaction. Successful exploitation of the vulnerability results in session hijacking, non-persistent phishing, non-persistent external redirects, non-persistent load of malicious script codes or non-persistent web module context manipulation. Request Method(s): [+] GET Vulnerable Module(s): [+] Reports > Advanced > Dataset Vulnerable Parameter(s): [+] name [+] query Affected Module(s): [+] View Dataset - SQL RUN Query Display During the client security tests the research team noticed that the official vm version and the all appliance models are affected by the security issue. The following versions and models of the fortinet fortianalyzer appliance web-application are affected by the remote cross site scripting vulnerability. Affected Model(s): [+] FortiManager 5.2.0 GA, 5.2.1 GA [+] FortiManager 5.0.3 GA to 5.0.10 GA release [+] FortiAnalyzer 5.0.0 GA to 5.2.1 GA release Affected Version(s): [+] 5.2.0, 5.2.1, 5.0.3 to 5.0.10 & 5.0.0 to 5.21 (GA) Proof of Concept (PoC): ======================= PoC: https://fortianalyzer.127.0.0.1:8080/p/report/dataset/sql/run/?logtype=1&device-list=%5B%22FGT60C3G12031338%5Broot%5D%22%5D& time-period=%7B%22week-start%22%3A0%2C%22period-opt%22%3A1%2C%22period-type%22%3A5%7D&sql-query=%20[NON-PERSISTENT INPUT VALIDATION VULNERABILITY!])%20%3C https://fortimanager.127.0.0.1:8080/p/report/dataset/sql/run/?logtype=1&device-list=%5B%22All_FortiGates%22%5D&time-period=%7B%22 week-start%22%3A0%2C%22period-opt%22%3A1%2C%22period-type%22%3A5%7D&sql-query=%20[NON-PERSISTENT INPUT VALIDATION VULNERABILITY!])%20%3C Exploit: PoC