VYPR
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.

PackageAffected versionsPatched versions
org.xwiki.platform:xwiki-platform-attachment-uiMaven
>= 2.0-rc-2, < 13.10.1113.10.11
org.xwiki.platform:xwiki-platform-attachment-uiMaven
>= 14.0-rc-1, < 14.4.814.4.8
org.xwiki.platform:xwiki-platform-attachment-uiMaven
>= 14.5, < 14.10.114.10.1

Affected products

1

Patches

1
aca1d677c585

XWIKI-20275: Improved escaping on XWiki.AttachmentSelector

https://github.com/xwiki/xwiki-platformManuel LeducDec 2, 2022via ghsa
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")&gt;&gt;${targetDocument}||class="button secondary" id="attachment-picker-close"]]
    +  (% class="buttonwrapper secondary" %)[[$cancelLinkName&gt;&gt;$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

News mentions

0

No linked articles in our index yet.