CVE-2023-46244: Incorrect Authorization (CWE-863)
value: XWiki Platform is a generic wiki platform offering runtime services for applications built on top of it. In affected versions it's possible for a user to write a script in which any velocity content is executed with the right of any other document content author. Since this API require programming right and the user does not have it, the expected result is `$doc.document.authors.contentAuthor` (not executed script), unfortunately with the security vulnerability it is possible for the attacker to get `XWiki.superadmin` which shows that the title was executed with the right of the unmodified document. This has been patched in XWiki versions 14.10.7 and 15.2RC1. Users are advised to upgrade. There are no known workarounds for this vulnerability.
CWE description: The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions.
CVSS v3 base score: 8.8
Published: 2023-11-07T19:15Z
Repository: https://github.com/xwiki/xwiki-platform
Language: XML
Files changed: xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-tree/xwiki-platform-index-tree-macro/src/main/resources/XWiki/DocumentTreeMacros.xml
Commit date: 2023-03-08 16:49:30 +0100
Commit message: XWIKI-20625: Improve document title display in the document tree

Diff: diff --git a/xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-tree/xwiki-platform-index-tree-macro/src/main/resources/XWiki/DocumentTreeMacros.xml b/xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-tree/xwiki-platform-index-tree-macro/src/main/resources/XWiki/DocumentTreeMacros.xml
index 59d980ac0350d..8fe0ec89c4aab 100644
--- a/xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-tree/xwiki-platform-index-tree-macro/src/main/resources/XWiki/DocumentTreeMacros.xml
+++ b/xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-tree/xwiki-platform-index-tree-macro/src/main/resources/XWiki/DocumentTreeMacros.xml
@@ -352,14 +352,10 @@
   #set ($canViewDoc = $services.security.authorization.hasAccess('view', $documentReference))
   #set ($canDeleteDoc = $services.security.authorization.hasAccess('delete', $documentReference))
   #if ($canViewDoc &amp;&amp; $docTreeConfig.showDocumentTitle)
     ## Display the translated title.
     #set ($translatedDocument = $xwiki.getDocument($documentReference).translatedDocument)
-    ## Make sure the displayed title is not affected by the sheet request parameter (e.g. when $translatedDocument is
-    ## the current document). By setting the title (even if we don't change it) the internal document instance is cloned
-    ## so it's going to be different than the current document instance (which is the target of the sheet parameter).
-    #set ($discard = $translatedDocument.setTitle($translatedDocument.title))
     #set ($plainTitle = $translatedDocument.plainTitle)
     #if (!$stringtool.isBlank($plainTitle))
       #set ($label = $plainTitle)
     #end
   #end

Vulnerable code:     ## Make sure the displayed title is not affected by the sheet request parameter (e.g. when $translatedDocument is
    ## the current document). By setting the title (even if we don't change it) the internal document instance is cloned
    ## so it's going to be different than the current document instance (which is the target of the sheet parameter).
    #set ($discard = $translatedDocument.setTitle($translatedDocument.title))