Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-2082

XSS vulnerability: HtmlResponse output does not escape URLs in HTML

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Servlets Post 2.1.0, API 2.2.0
    • Servlets Post 2.1.2, API 2.2.2
    • API, Servlets
    • None

    Description

      A POST request including a <script> in the URL can lead to execution of that script in the browser:

      http://localhost:4502/does/not/exist.html/%22%3e%3cscript%3ealert(29679)%3c/script%3e

      Test with curl:

      curl -X POST "http://localhost:4502/does/not/exist.html/%22%3e%3cscript%3ealert(29679)%3c/script%3e"

      I think this applies to both org/apache/sling/api/servlets/HtmlResponse and org/apache/sling/servlets/post/HtmlResponse, but not sure how to trigger the first one.

      Attachments

        Activity

          People

            bdelacretaz Bertrand Delacretaz
            alexander.klimetschek Alexander Klimetschek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: