GHSA-x7c2-7wvg-jpx7

Source
https://github.com/advisories/GHSA-x7c2-7wvg-jpx7
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/05/GHSA-x7c2-7wvg-jpx7/GHSA-x7c2-7wvg-jpx7.json
Aliases
Published
2023-05-22T19:39:46Z
Modified
2024-02-22T05:39:20.014016Z
Details

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, see GHSA-fwcf-753v-fgcj and Content-Security-Policy definition to prevent cross-site-scripting attacks, see GHSA-2wcr-87wf-cf9j.

The upload validation checks were not robust enough which left the possibility of an attacker to circumvent them and upload a potentially dangerous file. Exploting this flaw a combination of files could be uploaded so that they work together to circumvent the existing Content-Security-Policy and allow execution of arbitrary JavaScript in the browser.

Patches

  • File upload validation code has been improved
  • Kiwi TCMS will now force Content-Type: text/plain when serving uploaded files

Workarounds

1) Force the Content-Type header via a custom Django middleware, see ExtraHeadersMiddleware in https://github.com/kiwitcms/Kiwi/blob/master/tcms/core/middleware.py#L23 and/or 2) Force the Content-Type header via Nginx overrides, see location /uploads/ in https://github.com/kiwitcms/Kiwi/blob/master/etc/nginx.conf

References

Disclosed by Antonio Spataro and ek1ng. Additional credits to Ahmed Rabeaa Mosa.

References

Affected packages

PyPI / kiwitcms

Package

Name
kiwitcms

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0The exact introduced commit is unknown
Fixed
12.3

Affected versions

6.*

6.2.1
6.3
6.4
6.5
6.5.3
6.6
6.7
6.8
6.9
6.10
6.11

7.*

7.0
7.1
7.2
7.2.1
7.3

8.*

8.0
8.1
8.1.99
8.2
8.3
8.4
8.5
8.6
8.6.1
8.7
8.8
8.9

9.*

9.0
9.999

10.*

10.0
10.1
10.2
10.3
10.3.999
10.4
10.5

11.*

11.0
11.1
11.3
11.4
11.5
11.6
11.7

12.*

12.0
12.1
12.2