# Exploit Title: Drupal CKEditor 3.0 - 3.6.2 - Persistent EventHandler XSS # Google Dork: "inurl:"sites/all/modules/ckeditor" -drupalcode.org" # Google Results: Approximately 379.000 results # Date: 18th January 2012 # Author: MaXe @InterN0T (Found in a private Hatforce.com Penetration Test) # Software Link: http://ckeditor.com/ & http://drupal.org/node/1332022 # Version: 3.0 - Current 3.6.2 (Drupal module: 6.x-1.8) # Screenshot: If attached, see image file. # Tested on: Windows + FireFox 8.0 & Internet Explorer 8.0 Drupal CKEditor - Persistent / Stored Cross-Site Scripting Versions Affected: 3.0 - 3.6.2 (Developers confirm all versions since 3.0 are affected.) Info: CKEditor is a text editor to be used inside web pages. It's a WYSIWYG editor, which means that the text being edited on it looks as similar as possible to the results users have when publishing it. It brings to the web common editing features found on desktop editing applications like Microsoft Word and OpenOffice. External Links: http://ckeditor.com/ http://drupal.org/node/1332022 Credits: MaXe (@InterN0T) - Hatforce.com -:: The Advisory ::- CKEditor is prone to Persistent Cross-Site Scripting within the actual editor, as it is possible for an attacker could maliciously inject eventhandlers serving java- script code in preview / editing in html mode. If an attacker injects an eventhandler into an image, such as "onload='alert(0);'", then the javascript will execute, even if the data is saved and previewed in editing mode later on. (The XSS will only executing during preview / editing in html mode.) If an administrator tries to edit the comment afterward, or is logged in and browses to the edit page of the malicious comment, then he or she will execute the javascript, allowing attacker controlled code to run in the context of the browser. Proof of Concept: Switching to "raw mode" in CKEditor and then writing: