Kiwi TCMS's misconfigured HTTP headers allow stored XSS execution with Firefox
Kiwi TCMS served uploaded files with a Content-Type header that Firefox could ignore, allowing stored XSS execution. Attackers could upload dangerous files that execute scripts when accessed directly.
kiwitcms/kiwi
Originally disclosed on huntr
Impact
Kiwi TCMS allows users to upload attachments to test plans, test cases, etc. Earlier versions of Kiwi TCMS had introduced changes which were meant to serve all uploaded files as plain text in order to prevent browsers from executing potentially dangerous files when such files are accessed directly!
The previous Nginx configuration was incorrect allowing certain browsers like Firefox to ignore the Content-Type: text/plain header on some occasions thus allowing potentially dangerous scripts to be executed.
Additionally file upload validators and parts of the HTML rendering code have been found to require additional sanitation and improvements.
Patches
- Updated Nginx content type configuration
- Improved file upload validation code to prevent more potentially dangerous uploads
- Sanitization of test plan names used in the
tree_view_html()function
References
Disclosed by M Nadeem Qazi and Mahshooq Zubair.
From the GitHub Advisory Database (GHSA-jpgw-2r9m-8qfw, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the Nginx configuration did not correctly set the Content-Type header for uploaded files, and file upload validation and HTML rendering lacked sufficient sanitisation.
Impact
An attacker could upload a dangerous file that, when accessed directly, executes scripts in the victim's browser, potentially leading to stored XSS.
What the attacker needed
Ability to upload attachments; victim uses Firefox; victim accesses uploaded file directly
The fix
The issue was fixed by updating the Nginx content type configuration, improving file upload validation, and sanitising test plan names in the tree_view_html() function.
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 report has not been written yet. The Original tab links to the source.
When you upload a file to a website, the server tells the browser what type of file it is using a header called Content-Type. If the server says it is plain text, the browser should not run it as a program. But some browsers, like Firefox, sometimes ignore that instruction and run the file anyway, which lets an attacker run harmful code in your browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.