Details
-
Bug
-
Resolution: Fixed
-
Blocker
-
7.2-milestone-2
-
Unit
-
Unknown
-
N/A
-
N/A
-
Description
Steps to reproduce:
- Log in as a user with edit but no script right.
- Create a document "EvilDisplayer.WebHome".
- Edit this document with the class editor. Add a property named "title" (name doesn't matter) of type "Computed Field" with "Custom Display"
{{groovy}}println("Hello from Groovy Display!"){{/groovy}}
- Save this document.
- Go to the movies app in the help application ("Help.Applications.Movies.WebHome")
- Click on "Edit application" under "Actions".
- Click on the "Configure" icon in the "Genre" property".
- Change the order of two of the values (for example, move "Comedy" before "Action").
- Use the inspector in the web developer tools to find the "div" with "hidden" class before the "Genre" label
- Find the hidden input with the name "template-staticList1" and value "AppWithinMinutes.StaticList".
- Change the value to "EvilDisplayer.WebHome".
- Confirm the change of the genre with a click on the check icon at the top right of the input.
Expected result:
An error is displayed as the current user doesn't have programming right.
Actual result:
"Hello from Groovy Display!" is displayed which demonstrates a successful remote code execution:
The problem is that in https://github.com/xwiki/xwiki-platform/blob/a87cb9d9282d99e8e7fa82a77c4e8c0bbb0d8430/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java#L310-L314 the saved author is used for the right check with the new displayer value.
Attachments
Issue Links
- links to