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

Invalid path decomposition in case of multiple dots

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Engine 2.7.2
    • Engine 2.7.4
    • Engine
    • None

    Description

      The resource resolver performs path normalization using ResourceUtil.normalize().

      This leads to unexpected results in the case of a combination of non-existing resources, and multiple dots in a path segment.

      E.g. the following request:
      http://localhost/content/a.js/......children....-1....json/a.txt

      will be decomposed as follows:

      Extension=json
      resourcePath=/content/a.js/..
      selectors=[, , , children, , , , -1]
      seclectorString=...children....-1...
      suffix=/a.txt
      

      Note that the first two dots of the third path segment are interpreted as the parent path (a.js does not exist), which essentially turns this line into /content.children.-1.json/a.txt, which can confuse reverse proxies.

      I think the .. should only be interpreted as the parent path if followed by a / (or potentially a semicolon if path parameters on .. segments should be allowed).

      Attachments

        Issue Links

          Activity

            People

              davidb A. J. David Bosschaert
              chaotic Lars Krapf
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 5h 10m
                  5h 10m