Description

Discuz X3.4 is a full-featured, open-source web-platform.

offical : https://www.discuz.net/forum.php

src : https://gitee.com/ComsenzDiscuz/DiscuzX

version : latest

Recently, I found a stored xss. If option download remote img is opened to users, users can write a post includes evil code, everyone who views it will lead to xss.

poc

  1. open download remote img option to users.

01

  1. create a jpeg file in my server.

02

  1. write a post in forum, use download remote img to download a jpeg in my server. Intercept the request in burp.

03

  1. parameter message : <img src='http://domain:80/"onmouseover=alert(1)>llfam<a>.jpeg'>

04

  1. wrtie a new post. It will remind u a download jpeg is unused. use jpeg which download from my server.

05

  1. everyone who views the post will lead to xss.

06

other poc : "onmouseover=eval(String.fromCharCode(...))>llfam<a>.jpeg

analysis

source/module/forum/forum_ajax.php line 463

07

filename will be stored in database.

08

source/function/function_attachment.php line 89

09

$attach[‘imgalt’] : \"onmouseover=alert(1)>llfam<a>.jpeg

date/template/1_1_forum_discuzcode.tpl.php line 366

10

$attach[‘imgalt’] output to page directly.