VYPR
High severityNVD Advisory· Published Jun 6, 2023· Updated Jan 7, 2025

Stored cross site scripting (XSS) via unrestricted file upload in Kiwi TCMS

CVE-2023-33977

Description

Kiwi TCMS is an open source test management system for both manual and automated testing. 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. This issue has been addressed in version 12.4. Users are advised to upgrade. Users unable to upgrade who are serving Kiwi TCMS behind a reverse proxy should make sure that additional header values are still passed to the client browser. If they aren't redefining them inside the proxy configuration.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
kiwitcmsPyPI
< 12.412.4

Affected products

1

Patches

1
d789f4b51025

Improve upload validation to check for dangerous attributes

https://github.com/kiwitcms/kiwiAlexander TodorovMay 30, 2023via ghsa
3 files changed · +17 0
  • tcms/kiwi_attachments/tests/test_validators.py+13 0 modified
    @@ -25,6 +25,19 @@ def test_uploading_svg_with_inline_script_should_fail(self, file_name):
                 with self.assertRaisesRegex(Fault, message):
                     self.rpc_client.User.add_attachment("inline_javascript.svg", b64)
     
    +    @parameterized.expand(
    +        [
    +            "svg_with_onload_attribute.svg",
    +        ]
    +    )
    +    def test_uploading_svg_with_forbidden_attributes_should_fail(self, file_name):
    +        with open(f"tests/ui/data/{file_name}", "rb") as svg_file:
    +            b64 = base64.b64encode(svg_file.read()).decode()
    +
    +            message = str(_("File contains forbidden attribute:"))
    +            with self.assertRaisesRegex(Fault, message):
    +                self.rpc_client.User.add_attachment("image.svg", b64)
    +
         def test_uploading_filename_ending_in_dot_exe_should_fail(self):
             message = str(_("Uploading executable files is forbidden"))
             with self.assertRaisesRegex(Fault, message):
    
  • tcms/kiwi_attachments/validators.py+3 0 modified
    @@ -7,6 +7,9 @@ def deny_uploads_containing_script_tag(uploaded_file):
             if chunk.lower().find(b"<script") > -1:
                 raise ValidationError(_("File contains forbidden <script> tag"))
     
    +        if chunk.lower().find(b"onload=") > -1:
    +            raise ValidationError(_("File contains forbidden attribute:") + "onload")
    +
     
     def deny_uploads_ending_in_dot_exe(uploaded_file):
         message = _("Uploading executable files is forbidden")
    
  • tests/ui/data/svg_with_onload_attribute.svg+1 0 added
    @@ -0,0 +1 @@
    +<svg xmlns="http://www.w3.org/2000/svg" onload="alert(document.domain)"><defs><font id="x"><font-face font-family="y"/></font></defs></svg>
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

10

News mentions

0

No linked articles in our index yet.