CVE-2023-36809: Kiwi TCMS's misconfigured HTTP headers allow stored XSS execution with Firefox
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 treeviewhtml() function
References
Disclosed by M Nadeem Qazi and Mahshooq Zubair.
Other sources
Kiwi TCMS, an open source test management system allows users to upload attachments to test plans, test cases, etc. Versions of Kiwi TCMS prior to 12.5 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 had been found to require additional sanitation and improvements. Version 12.5 fixes this vulnerability with updated Nginx content type configuration, improved file upload validation code to prevent more potentially dangerous uploads, and Sanitization of test plan names used in the treeviewhtml() function.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/kiwitcmsto a version that resolves this vulnerability.Fixed in 12.5 - Upgrade
Upgrade
Kiwi TCMSto a version that resolves this vulnerability.Fixed in 12.5 - Configuration
Update the Nginx content type configuration as in Kiwi TCMS 12.5 to prevent browsers like Firefox from ignoring `Content-Type: text/plain` and executing potentially dangerous scripts.
Nginx content type configuration = updated - Configuration
Apply the improved file upload validation code from Kiwi TCMS 12.5 to add additional sanitation and prevent more potentially dangerous uploads.
Kiwi TCMS file upload validators file upload validation logic = improved/sanitized - Configuration
Apply the sanitization of test plan names used in the `tree_view_html()` function from Kiwi TCMS 12.5 to prevent stored XSS.
Kiwi TCMS HTML rendering (tree_view_html) test plan name sanitization = sanitized
Event History
Frequently Asked Questions
What is the severity of CVE-2023-36809?
CVE-2023-36809 is considered a high severity vulnerability as it may allow the execution of malicious files uploaded by users.
How do I fix CVE-2023-36809?
To fix CVE-2023-36809, upgrade Kiwi TCMS to version 12.5 or later where the vulnerability has been addressed.
What type of attack can CVE-2023-36809 enable?
CVE-2023-36809 can enable remote code execution attacks if an attacker uploads a malicious file.
Which versions of Kiwi TCMS are affected by CVE-2023-36809?
Kiwi TCMS versions prior to 12.5 are affected by CVE-2023-36809.
How does CVE-2023-36809 impact user data?
CVE-2023-36809 can allow unauthorized access to user data by executing harmful scripts through uploaded files.