(CVE-2023-1720) Bitrix24 Stored Cross-Site Scripting (XSS) via File Upload
Bitrix24 did not set a MIME type response header when serving uploaded files, so an authenticated attacker could upload a crafted HTML file that executes JavaScript in a victim's browser. If the victim is an administrator, this could possibly lead to arbitrary PHP code execution on the server.
starlabs.sg
Published on starlabs.sg
This report presents information on a Cross Site Scripting (XSS) vulnerability that allows an attacker to run arbitrary JavaScript code on the browser of any victim that visits the affected page. If the victim has administrator permissions, an attacker may leverage the built-in “PHP Command Line” feature to execute…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the file upload endpoint did not set a Content-Type response header, so browsers rendered uploaded HTML files as active web content instead of downloading them.
Impact
An authenticated attacker could execute arbitrary JavaScript in a victim's browser, and possibly execute arbitrary PHP code on the server if the victim has administrator privilege.
What the attacker needed
Authenticated account; victim opens the uploaded file
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you upload a file to a website, the server usually tells the browser what kind of file it is using a 'MIME type' header. Bitrix24 did not send that header, so the browser guessed and treated an uploaded HTML file as a web page. That let an attacker run JavaScript in the victim's browser, and if the victim was an admin, possibly run code on the server too.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.