Skip to content
XSS Disclosed report Intermediate CVE-2023-33977

kiwitcms vulnerable to stored cross-site scripting via unrestricted file upload

Kiwi TCMS allowed users to upload attachments, and the file upload validation could be bypassed to upload a dangerous file that executes arbitrary JavaScript in the browser. Additionally, Nginx's proxy_pass directive stripped some headers, negating protections when served behind a reverse proxy.

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 upload validators in order to prevent potentially dangerous files from being uploaded and Content-Security-Policy definition to prevent cross-site-scripting attacks.

The upload validation checks were not 100% robust which left the possibility to circumvent them and upload a potentially dangerous file which allows execution of arbitrary JavaScript in the browser. Additionally we've discovered that Nginx's proxy_pass directive will strip some headers negating protections built into Kiwi TCMS when served behind a reverse proxy.

Patches

  • Improved file upload validation code
  • Updated Nginx reverse proxy configuration for *.tenant.kiwitcms.org

Workarounds

If serving Kiwi TCMS behind a reverse proxy make sure that additional header values are still passed to the client browser. If they aren't redefine them inside the proxy configuration. See etc/nginx.conf#L66-L68 and etc/nginx.conf#L87

References

Disclosed by M Nadeem Qazi.

From the GitHub Advisory Database (GHSA-2fqm-m4r2-fh98, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

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 file upload validation was incomplete and did not block all dangerous file types, and the reverse proxy configuration stripped security headers.

Impact

An attacker could upload a file that executes arbitrary JavaScript in a victim's browser, and the proxy header stripping could weaken protections, though the text does not specify the exact impact.

What the attacker needed

Ability to upload attachments; victim opens the uploaded file; served behind a reverse proxy (for header issue)

The fix

The file upload validation was improved and the Nginx reverse proxy configuration was updated to pass additional header values.

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.

Kiwi TCMS lets users attach files to test plans and cases. The checks that decide which files are safe were not strong enough, so someone could upload a file that runs JavaScript when opened. Also, when Kiwi TCMS sits behind a proxy server, that proxy removed some security headers, making the problem worse.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from kiwitcms/kiwi

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.