CVE-2023-26472 (published 2023-03-02T19:15Z)

XWiki Platform is a generic wiki platform. Starting in version 6.2-milestone-1, one can execute any wiki content with the right of IconThemeSheet author by creating an icon theme with certain content. This can be done by creating a new page or even through the user profile for users not having edit right. The issue has been patched in XWiki 14.9, 14.4.6, and 13.10.10. An available workaround is to fix the bug in the page `IconThemesCode.IconThemeSheet` by applying a modification from commit 48caf7491595238af2b531026a614221d5d61f38.

CVSS v3 base score: 8.8, HIGH (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-116
cwe_name: Improper Encoding or Escaping of Output
description: The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.
extended_description: 
            Improper encoding or escaping can allow attackers to change the commands that are sent to another component, inserting malicious commands instead.
            Most products follow a certain protocol that uses structured messages for communication between components, such as queries or commands. These structured messages can contain raw data interspersed with metadata or control information. For example, "GET /index.html HTTP/1.1" is a structured message containing a command ("GET") with a single argument ("/index.html") and metadata about which protocol version is being used ("HTTP/1.1").
            If an application uses attacker-supplied inputs to construct a structured message without properly encoding or escaping, then the attacker could insert special characters that will cause the data to be interpreted as control information or metadata. Consequently, the component that receives the output will perform the wrong operations, or otherwise interpret the data incorrectly.
         
         

Fix information:
repo_url: https://github.com/xwiki/xwiki-platform
commit_details: repo_url: https://github.com/xwiki/xwiki-platform
author: Thomas Mortagne
author_date: 2022-10-20 18:00:15+02:00
msg: XWIKI-19731: Fix escaping
* better fix (thanks @michitux for the warning)
repository: repo_url: https://github.com/xwiki/xwiki-platform
repo_name: xwiki/xwiki-platform
description: The XWiki platform
repo_language: Java
owner: xwiki
file_changes: filename: IconThemesSheetIT.java
change_type: ModificationType.DELETE
diff: @@ -1,61 +0,0 @@
-/*
- * See the NOTICE file distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.xwiki.icon.test.ui;
-
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Order;
-import org.junit.jupiter.api.Test;
-import org.openqa.selenium.By;
-import org.xwiki.test.docker.junit5.TestReference;
-import org.xwiki.test.docker.junit5.UITest;
-import org.xwiki.test.ui.TestUtils;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-/**
- * Functional tests of the icon theme sheet.
- *
- * @version $Id$
- */
-@UITest
-class IconThemesSheetIT
-{
-    @BeforeEach
-    void setUp(TestUtils testUtils)
-    {
-        // Login as superadmin to define the preferences. 
-        testUtils.loginAsSuperAdmin();
-    }
-
-    @Test
-    @Order(1)
-    void createIconTheme(TestUtils testUtils, TestReference testReference) throws Exception
-    {
-        testUtils.createPage(testReference, ")))**not bold**");
-        testUtils.addObject(testReference, "IconThemesCode.IconThemeClass");
-
-        testUtils.gotoPage(testReference);
-
-        String content = testUtils.getDriver().findElementWithoutWaiting(By.id("xwikicontent")).getText();
-
-        // Make sure the wiki syntax was not interpreted
-        assertTrue(content.contains("**not bold**"));
-    }
-}

programming_language: unknown
filename: IconThemeSheet.xml
change_type: ModificationType.MODIFY
diff: @@ -42,10 +42,9 @@
 This document is an Icon Theme.
 {{/info}}
 
-
-{{{
-$doc.content.replace('}}}', '~}}}')
-}}}
+(%class="code"%)(((
+$services.rendering.escape($doc.content, 'xwiki/2.1')
+)))
 #else
 Sheet of [[IconThemesCode.IconThemeClass]]
 #end

programming_language: TypeScript