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

XSSAPI#encodeForJSString is too restrictive

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • XSS Protection API 1.0.6
    • XSS Protection API 1.0.8
    • Extensions
    • None

    Description

      For the cases when somebody tries to sanitise JSON strings the XSSAPI#encodeForJSString current implementation is too restrictive.

      Assuming one would want to sanitize 2016-01-21T15:40:30, the output of the XSSAPI#encodeForJSString would be

      2016\-01\-21T15:40:30
      

      which although is a valid String for JavaScript code is not a valid one for JSON.

      Attachments

        Activity

          People

            radu Radu Cotescu
            radu Radu Cotescu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: