CVE-2023-29207 (Other, published 2023-04-15T16:15Z)
Description: value:  XWiki Commons are technical libraries common to several other top level XWiki projects. The Livetable Macro wasn't properly sanitizing column names, thus allowing the insertion of raw HTML code including JavaScript. This vulnerability was also exploitable via the Documents Macro that is included since XWiki 3.5M1 and doesn't require script rights, this can be demonstrated with the syntax `{{documents id="example" count="5" actions="false" columns="doc.title, before<script>alert(1)</script>after"/}}`. Therefore, this can also be exploited by users without script right and in comments. With the interaction of a user with more rights, this could be used to execute arbitrary actions in the wiki, including privilege escalation, remote code execution, information disclosure, modifying or deleting content. This has been patched in XWiki 14.9, 14.4.6, and 13.10.10.

Severity: nan (CVSS v3 base score: 9)
Weakness: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Repository: https://github.com/xwiki/xwiki-platform
Files changed:
xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/macros.vm
xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/macros.vm
Commit message: XWIKI-15205: Improve escaping in LiveTable


Vulnerable code:
              <th scope="col" class="xwiki-livetable-display-header-text $!colprop.headerClass
                #if($isSortable)<a data-rel="${colname}">#end
                $displayName
    <select id="xwiki-livetable-${htmlLiveTableId}-filter-${foreach.count}" name="$column"
        ><option value="">$services.localization.render('platform.livetable.selectAll')</option>
      <option value="$storedValue">$displayedValue</option>
    <select id="xwiki-livetable-${htmlLiveTableId}-filter-${foreach.count}" name="$column">
    <input id="xwiki-livetable-${htmlLiveTableId}-filter-${foreach.count}" name="$column" type="text"
              <th scope="col" class="xwiki-livetable-display-header-text $!colprop.headerClass
                #if($isSortable)<a rel="${colname}">#end
                $displayName
    <select id="xwiki-livetable-${htmlLiveTableId}-filter-${foreach.count}" name="$column"
        ><option value="">$services.localization.render('platform.livetable.selectAll')</option>
      <option value="$storedValue">$displayedValue</option>
    <select id="xwiki-livetable-${htmlLiveTableId}-filter-${foreach.count}" name="$column">
    <input id="xwiki-livetable-${htmlLiveTableId}-filter-${foreach.count}" name="$column" type="text"

Fixed code:
              <th scope="col" class="xwiki-livetable-display-header-text $!escapetool.xml($colprop.headerClass)
                #if($isSortable)<a data-rel="${escapetool.xml($colname)}">#end
                $escapetool.xml($displayName)
    <select id="xwiki-livetable-${htmlLiveTableId}-filter-${foreach.count}" name="$!escapetool.xml($column)"
        ><option value="">$escapetool.xml($services.localization.render('platform.livetable.selectAll'))</option>
      <option value="$!escapetool.xml($storedValue)">$!escapetool.xml($displayedValue)</option>
    <select id="xwiki-livetable-${htmlLiveTableId}-filter-${foreach.count}" name="$!escapetool.xml($column)">
    <input id="xwiki-livetable-${htmlLiveTableId}-filter-${foreach.count}" name="$!escapetool.xml($column)" type="text"
              <th scope="col" class="xwiki-livetable-display-header-text $!escapetool.xml($colprop.headerClass)
                #if($isSortable)<a rel="${escapetool.xml($colname)}">#end
                $escapetool.xml($displayName)
    <select id="xwiki-livetable-${htmlLiveTableId}-filter-${foreach.count}" name="$!escapetool.xml($column)"
        ><option value="">$escapetool.xml($services.localization.render('platform.livetable.selectAll'))</option>
      <option value="$!escapetool.xml($storedValue)">$!escapetool.xml($displayedValue)</option>
    <select id="xwiki-livetable-${htmlLiveTableId}-filter-${foreach.count}" name="$!escapetool.xml($column)">
    <input id="xwiki-livetable-${htmlLiveTableId}-filter-${foreach.count}" name="$!escapetool.xml($column)" type="text"