id: wildcard-postmessage

info:
  name: postMessage - Cross-Site Scripting
  author: pdteam
  severity: unknown
  description: postMessage contains a cross-site scripting vulnerability. An attacker can execute arbitrary script and therefore steal cookie-based authentication credentials and launch other attacks.
  reference:
    - https://jlajara.gitlab.io/web/2020/06/12/Dom_XSS_PostMessage.html
    - https://payatu.com/blog/anubhav.singh/postmessage-vulnerabilities
    - https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
  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-346
  metadata:
    max-request: 1
  tags: xss,postmessage,misconfig,vuln

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

    matchers:
      - type: regex
        regex:
          - postMessage\([a-zA-Z]+,["']\*["']\)
# digest: 490a00463044022033f0057ace389213678cfdb790c3eecbdd29268e5063ddffec3a1e622d7b9ee002200152dad8b2d53a1e785a0bf39409f70cfb3e6326ca746e027801b7c089c5909c:922c64590222798bb761d5b6d8e72950