id: unauthenticated-varnish-cache-purge

info:
  name: Varnish Unauthenticated Cache Purge
  author: 0xelkomy
  severity: low
  description: As per guideline one should protect purges with ACLs from unauthorized hosts.
  reference:
    - https://book.varnish-software.com/4.0/chapters/Cache_Invalidation.html
    - https://hackerone.com/reports/154278
  metadata:
    max-request: 1
  tags: misconfig,cache,hackerone,varnish,vuln

http:
  - method: PURGE
    path:
      - "{{BaseURL}}"

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '<title>200 Purged</title>'
          - '"status": "ok"'
        condition: or

      - type: status
        status:
          - 200
# digest: 490a0046304402202c385aa7bd9654ccf7f6100d4c3435a5a2a0e48bc16aab10e7695b97737a9fff0220722c2fdccef3442f161a2c883ebc18b63510d39b627db45c7d78258b4a759aa6:922c64590222798bb761d5b6d8e72950