Skip to content

7Ragnarok7/Redactor-JS-4-XSS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redactor JS 4 XSS

This repository documents the vulnerability details and exploit for Redactror JS 4 and prior versions.

Metrics

Vulnerability Overview

This Proof of Concept (POC) demonstrates the exploitation of an XSS vulnerability discovered by me recently in the Redactror JS WYSIWYG editor, which affects all versions of Redactor JS 4 and its prior versions. The library fails to sanitize various tags, attributes and event handlers, which allows JavaScript execution within the editor.

Prerequisites

  1. Redactor JS (version <= 4.*.*): https://imperavi.com/redactor/examples/initialization/base-example/

Reproduction Steps

This vulnerability can be tested using the latest version of Redactor JS 4 instance present here.

To test this vulnerability using Redactor JS 3 instead, navigate here.

  1. Switch to Source/HTML mode and insert payloads:

    • Open the Redactor JS instance and click on the "HTML" icon.

    • Insert the following payloads in the text area:

      <iframe srcdoc="<script>alert`iframe`</script>"></iframe>
      <var onmouseover="alert`XSS`">XSS</var>
      <img src="x" onclick="alert`click`">

      Redactor Preview Screenshot

      Payload Insertion Screenshot

  2. Switch to WYSIWYG Mode:

    • Click on the "HTML" icon again to switch back to the WYSIWYG mode.

    • Observe the <iframe> tag payload getting triggered automatically.

      Payload Insertion Screenshot

    • Observe the custom <var> tag payload getting triggered after hovering the mouse over the XSS text.

      Payload Insertion Screenshot

    • Observe the <img> tag payload getting triggered after clicking on the broken image icon.

      XSS Trigger Screenshot

Advisory

Important Links