CVE-2023-22457 (published 2023-01-04T15:15Z)

CKEditor Integration UI adds support for editing wiki pages using CKEditor. Prior to versions 1.64.3,t he `CKEditor.HTMLConverter` document lacked a protection against Cross-Site Request Forgery (CSRF), allowing to execute macros with the rights of the current user. If a privileged user with programming rights was tricked into executing a GET request to this document with certain parameters (e.g., via an image with a corresponding URL embedded in a comment or via a redirect), this would allow arbitrary remote code execution and the attacker could gain rights, access private information or impact the availability of the wiki. The issue has been patched in the CKEditor Integration version 1.64.3. This has also been patched in the version of the CKEditor integration that is bundled starting with XWiki 14.6 RC1. There are no known workarounds for this other than upgrading the CKEditor integration to a fixed version.

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

Weakness information:
cwe_id: CWE-352
cwe_name: Cross-Site Request Forgery (CSRF)
description: The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
extended_description: When a web server is designed to receive a request from a client without any mechanism for verifying that it was intentionally sent, then it might be possible for an attacker to trick a client into making an unintentional request to the web server which will be treated as an authentic request. This can be done via a URL, image load, XMLHttpRequest, etc. and can result in exposure of data or unintended code execution.
         

Fix information:
repo_url: https://github.com/xwiki-contrib/application-ckeditor
commit_details: repo_url: https://github.com/xwiki-contrib/application-ckeditor
author: Michael Hamann
author_date: 2022-07-05 15:30:25+02:00
msg: CKEDITOR-475: Add form token check to HTMLConverter
repository: repo_url: https://github.com/xwiki-contrib/application-ckeditor
repo_name: xwiki-attic/application-ckeditor
description: CKEditor integration in XWiki
repo_language: JavaScript
owner: xwiki-contrib
file_changes: filename: plugin.js
change_type: ModificationType.MODIFY
diff: @@ -60,7 +60,8 @@
         htmlConverter: sourceDocument.getURL('get', $.param({
           sheet: 'CKEditor.HTMLConverter',
           outputSyntax: 'plain',
-          language: $('html').attr('lang') || ''
+          language: $('html').attr('lang') || '',
+          formToken: document.documentElement.dataset.xwikiFormToken || ''
         }))
       }, editor.config['xwiki-source']);
 

programming_language: JavaScript
filename: HTMLConverter.xml
change_type: ModificationType.MODIFY
diff: @@ -41,7 +41,7 @@
 {{velocity wiki="false"}}
 #set ($toHTML = $request.toHTML == 'true')
 #set ($fromHTML = $request.fromHTML == 'true')
-#if ($toHTML || $fromHTML)
+#if (($toHTML || $fromHTML) &amp;&amp; $services.csrf.isTokenValid($request.formToken))
   #set ($text = "$!request.text")
   #set ($stripHTMLEnvelope = $request.stripHTMLEnvelope == 'true')
   #set ($output = "#ckeditor_convert($text $toHTML $fromHTML $stripHTMLEnvelope)")

programming_language: PHP