Critical severityNVD Advisory· Published Apr 18, 2023· Updated Feb 5, 2025
Code injection from view right on XWiki.AttachmentSelector in xwiki-platform
CVE-2023-29516
Description
XWiki Platform is a generic wiki platform offering runtime services for applications built on top of it. Any user with view rights on XWiki.AttachmentSelector can execute arbitrary Groovy, Python or Velocity code in XWiki leading to full access to the XWiki installation. The root cause is improper escaping in the "Cancel and return to page" button. This page is installed by default. This vulnerability has been patched in XWiki 15.0-rc-1, 14.10.1, 14.4.8, and 13.10.11. There are no known workarounds for this vulnerability.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.xwiki.platform:xwiki-platform-attachment-uiMaven | >= 2.0-rc-2, < 13.10.11 | 13.10.11 |
org.xwiki.platform:xwiki-platform-attachment-uiMaven | >= 14.0-rc-1, < 14.4.8 | 14.4.8 |
org.xwiki.platform:xwiki-platform-attachment-uiMaven | >= 14.5, < 14.10.1 | 14.10.1 |
Affected products
1- Range: < 13.10.11
Patches
1aca1d677c585XWIKI-20275: Improved escaping on XWiki.AttachmentSelector
2 files changed · +18 −2
xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-ui/src/main/resources/XWiki/AttachmentSelector.xml+3 −1 modified@@ -371,8 +371,10 @@ $xwiki.jsx.use($attachmentPickerDocName) $!targetDocument.use($targetDocument.getObject($options.classname, $options.object))## #attachmentPicker_displayAttachmentGallery($targetDocument, $targetAttachDocument, $options) + #set ($cancelLinkName = $services.rendering.escape($services.rendering.escape($services.localization.render("${translationPrefix}.cancel"), 'xwiki/2.1'), 'xwiki/2.1')) + #set ($cancelLinkTarget = $services.rendering.escape($services.model.serialize($targetDocument), 'xwiki/2.1')) (% class="gallery_buttons buttons" %)((( - (% class="buttonwrapper secondary" %)[[$services.localization.render("${translationPrefix}.cancel")>>${targetDocument}||class="button secondary" id="attachment-picker-close"]] + (% class="buttonwrapper secondary" %)[[$cancelLinkName>>$cancelLinkTarget||class="button secondary" id="attachment-picker-close"]] ))) #end {{/velocity}}</content>
xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-ui/src/test/java/org/xwiki/attachment/AttachmentSelectorPageTest.java+15 −1 modified@@ -40,6 +40,7 @@ import org.xwiki.component.wiki.internal.bridge.DefaultContentParser; import org.xwiki.icon.IconManagerScriptService; import org.xwiki.icon.internal.DefaultIconManagerComponentList; +import org.xwiki.model.internal.reference.converter.EntityReferenceConverter; import org.xwiki.model.reference.AttachmentReference; import org.xwiki.model.reference.DocumentReference; import org.xwiki.model.script.ModelScriptService; @@ -110,7 +111,9 @@ // End WikiMacroEventListener TemporaryAttachmentsScriptService.class, IconManagerScriptService.class, - DocumentReferenceConverter.class + DocumentReferenceConverter.class, + EntityReferenceConverter.class, + ModelScriptService.class, }) class AttachmentSelectorPageTest extends PageTest { @@ -336,6 +339,17 @@ void withTemporaryAttachment() throws Exception + "be found"); } + @Test + void cancelButton() throws Exception + { + commonFixup("test.png"); + + this.request.put("docname", "xwiki:Space.]] {{noscript/}}"); + + Document document = renderHTMLPage(new DocumentReference("xwiki", "XWiki", "AttachmentSelector")); + assertEquals("Space.]] {{noscript/}}", document.getElementById("attachment-picker-close").attr("href")); + } + private void attachmentSelectorMacroFixup() throws Exception { DocumentReference attachmentSelectorDocumentReference =
Vulnerability mechanics
Synthesis attempt was rejected by the grounding validator. Re-run pending.
References
5- github.com/advisories/GHSA-3989-4c6x-725fghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2023-29516ghsaADVISORY
- github.com/xwiki/xwiki-platform/commit/aca1d677c58563bbe6e35c9e1c29fd8b12ebb996ghsax_refsource_MISCWEB
- github.com/xwiki/xwiki-platform/security/advisories/GHSA-3989-4c6x-725fghsax_refsource_CONFIRMWEB
- jira.xwiki.org/browse/XWIKI-20275ghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.