Any user with the right to edit his personal page can follow one of the scenario below:
Scenario 1:
{{async async="true" cached="false" context="doc.reference"}}{{groovy}}println("Hello from groovy!"){{/groovy}}{{/async}}.png as new attachment name and submit the renameHello from groovy! is displayed as the title of the attachmentScenario 2:
MyPage.WebHomeavatarMyPage.WebHome on the pageattachmentSelector macro in the document with the following values:
MyPage.WebHomeavatardirecttrue]] {{async async="true" cached="false" context="doc.reference"}}{{groovy}}println("Hello from groovy!"){{/groovy}}{{/async}}. You'll find below a snippet of an attachmentSelector macro declaration.Hello from groovy is displayed aside the imageExample of an attachmentSelector macro declaration:
`{{attachmentSelector classname="MyPage.WebHome" property="avatar" savemode="direct" displayImage="true" width="]] {{async async=~"true~" cached=~"false~" context=~"doc.reference~"~}~}{{groovy~}~}println(~"Hello from groovy!~"){{/groovy~}~}{{/async~}~}"/}}`
Note: The issue can also be reproduced by inserting the dangerous payload in the height or alt macro properties.
The issue can be fixed on a running wiki by updating XWiki.AttachmentSelector with the versions below:
No known workaround.
If you have any questions or comments about this advisory:
{
"cwe_ids": [
"CWE-95"
],
"github_reviewed": true,
"github_reviewed_at": "2022-11-21T22:34:57Z",
"nvd_published_at": "2022-11-23T19:15:00Z",
"severity": "CRITICAL"
}