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

Privilege escalation/RCE via the edit action

    XMLWordPrintable

Details

    • Unit
    • Unknown
    • N/A

    Description

      Steps to reproduce:

      1. Log in as a user without programming or script right.
      2. Open the URL <xwiki-host>/xwiki/bin/edit/<document>/?content=%7B%7Bgroovy%7D%7Dprintln%28%22Hello+from+Groovy%21%22%29%7B%7B%2Fgroovy%7D%7D&xpage=view, where <xwiki-host> is the URL of your XWiki installation and <document> is the path to a document whose content author has programming right (or script right) and on which the current user has edit right.

      Expected result:

      An error is displayed as the current user doesn't have programming right.

      Actual result:

      The text "Hello from Groovy!" is displayed in the page content, showing that the Groovy macro has been executed.

      The reason for this is that the edit action sets the content without modifying the content author.

      Note that this attack even works for a user without edit right if the user account has been created by an admin with programming right (this requires passing the parameter sheet= to disable the default display sheet).

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: