Details
-
Bug
-
Resolution: Fixed
-
Critical
-
14.10.5, 15.1-rc-1, 18.9.0
-
Unit
-
Unknown
-
N/A
-
N/A
-
Description
Steps to reproduce
- Log in as an administrator.
- Create a page in a new space, e.g. DeleteSpaceRepro.WebHome.
- Open the space delete confirmation with a redirect URL that has two query parameters, /xwiki/bin/view/Main/?a=1&b=2:
/xwiki/bin/deletespace/DeleteSpaceRepro/WebHome?xredirect=%2Fxwiki%2Fbin%2Fview%2FMain%2F%3Fa%3D1%26b%3D2
- Click No.
Expected result
The browser goes to /xwiki/bin/view/Main/?a=1&b=2.
Actual result
The browser goes to:
/xwiki/bin/view/Main/?a=1&b=2
The # of & starts the URL fragment, so only a=1 is kept as query parameter and #38;b=2 becomes the fragment. Any redirect URL is cut at its first &, in its query string or in its fragment.
Reproduced on XWiki 18.9.0 (Jetty HSQLDB distribution) with Chrome.
Cause
templates/deletespace.vm computes the cancel URL with the #getSanitizedURLAttributeValue macro, which already returns an XML-escaped value, and then escapes it again with $escapetool.xml($cancelURL) when passing it to #xwikimessagebox. The & of the URL thus ends up as & in the HTML, which the browser reads as the literal text &.
The double escaping was introduced when the xredirect parameter started to be sanitized in XWIKI-20612. The application delete confirmation of App Within Minutes (AppWithinMinutes.DeleteApplication) received the same change in XWIKI-20614 and escapes its cancel URL twice in the same way.
Without an xredirect parameter, the cancel URL is the space home page and is escaped only once, so it works.
Attachments
Issue Links
- is caused by
-
XWIKI-20612 RXSS via xredirect parameter in deletespace template
-
- Closed
-
-
XWIKI-20614 RXSS via xredirect paramer in DeleteApplication
-
- Closed
-