Lucene search

K
huntrBenasinEC2A29DC-79A3-44BD-A58B-15F676934AF6
HistoryDec 24, 2022 - 10:56 a.m.

Stored XSS in resource file uploading

2022-12-2410:56:47
benasin
www.huntr.dev
9
xss
resource upload
html file
javascript
content security policy

0.001 Low

EPSS

Percentile

20.3%

Description

The Resources upload feature does not restrict the type of uploaded file.
An attacker can upload an html file and the browser still renders it.
The CSP is set to default-src ‘self’ to prevent inline script execution.
However, this can be easily bypassed by uploading a .js file then include it through the html file.

Proof of Concept

First we upload a malicious js file onto the server

// step1.js 
alert(document.domain);

Then we upload a html file which includes this script

// step2.html
<script src=/path/step1.js></script>

The JavaScript code will be executed

Link POC

Video POC

0.001 Low

EPSS

Percentile

20.3%

Related for EC2A29DC-79A3-44BD-A58B-15F676934AF6