id: missing-cookie-samesite-strict

info:
  name: Missing Cookie SameSite Strict
  author: lucky0x0d,PulseSecurity.co.nz
  severity: info
  description: |
    Identified cookies that lacked the samesite=strict attribute, which prevented enforcement of restrictions on cross-domain cookie transmission.
  reference:
    - https://pulsesecurity.co.nz/articles/samesite-lax-csrf
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
    cvss-score: 0
    cwe-id: CWE-693
  metadata:
    verified: true
    max-request: 1
  tags: misconfig,samesite,cookie,vuln

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

    host-redirects: true
    max-redirects: 2

    matchers-condition: and
    matchers:
      - type: regex
        part: header
        regex:
          - '(?i)set-cookie:\s*([^=]+)=[^;]*(?:;|$)'

      - type: regex
        part: header
        regex:
          - "(?i)samesite=strict"
        negative: true

    extractors:
      - type: kval
        part: header
        kval:
          - 'set_cookie'
# digest: 490a0046304402200db9e7e86917032ad664226a12e4f40e86446d76b47a5e1f9014990f7cd505f802201fb6e68e9414c65e283bc725e66eadf1029447d438422cf15ee6a4a1bb8e09ba:922c64590222798bb761d5b6d8e72950