Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-20847

Velocity execution without script right through VelocityWiki property

    XMLWordPrintable

Details

    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      Steps to reproduce:

      1. Log in as a user without script right
      2. 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 "VelocityWiki".
      3. Edit the same document with the object editor and add an object of the just created class. Set its content to $request.cookies.
      4. 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 is caused by XWIKI-18222 which introduced the "VelocityWiki" type.

      Attachments

        Issue Links

          Activity

            People

              MichaelHamann Michael Hamann
              MichaelHamann Michael Hamann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: