Details
-
Bug
-
Resolution: Fixed
-
Blocker
-
7.2
-
Unit
-
Unknown
-
N/A
-
N/A
-
Description
Steps to reproduce:
- Log in as a user without script right
- Edit your user profile (or any other document) with the class editor and add a new field of type "TextArea", named "Test" and set "Content Type" to "VelocityCode".
- Edit the same document with the object editor and add an object of the just created class. Set its content to $request.cookies.
- Edit the document with the wiki editor and use the developer tools to set the value of the selected document syntax to xwiki/1.0 (no need to have XWiki 1.0 syntax installed, just ignore the errors). Save the document.
- Open <xwiki-host>/xwiki/bin/get/XWiki/username?xpage=display&property=XWiki.username.Test&type=object where <xwiki-host> is the URL of your XWiki installation and username is your user's name.
Expected result:
$request.cookies is displayed.
Actual result:
Content similar to [javax.servlet.http.Cookie@2f0535e1, javax.servlet.http.Cookie@3ed6f4f6, javax.servlet.http.Cookie@6eb94904, javax.servlet.http.Cookie@4e4fbe60, javax.servlet.http.Cookie@48632075] is displayed, showing that the Velocity code has been executed. Note that while the Velocity code is executed, it is executed with the correct context author. Therefore, no privileged APIs can be accessed. However, still dangerous data might be accessed and security issues that are only exploitable with script right can be exploited.
This issue is probably very old but I'm setting the affects version to 7.2 as in XWiki 7.2, script right was introduced and thus only since 7.2 script execution without script right can be considered a security issue.
Attachments
Issue Links
- links to