id: xss-deprecated-header

info:
  name: XSS-Protection Header - Cross-Site Scripting
  author: joshlarsen
  severity: info
  description: Setting the XSS-Protection header is deprecated. Setting the header to anything other than `0` can actually introduce an XSS vulnerability.
  reference:
    - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
    - https://owasp.org/www-project-secure-headers/#x-xss-protection
  classification:
    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
    cvss-score: 0
    cwe-id: CWE-79
  metadata:
    max-request: 1
  tags: xss,misconfig,generic,vuln

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

    matchers-condition: and
    matchers:
      - type: regex
        part: header
        regex:
          - "(?i)x-xss-protection: 0"
        negative: true

      - type: regex
        part: header
        regex:
          - "(?i)x-xss-protection: 1+"

    extractors:
      - type: kval
        part: header
        kval:
          - x_xss_protection
# digest: 4a0a00473045022100b743803e263c76218a25c17e35653994e5031450b736caaf8de40fed94ae0e6402202bfcf67e497100ab99f58b335b037142188806590ff3df931021a4796631bbb7:922c64590222798bb761d5b6d8e72950