|
| 1 | +--- |
| 2 | +gem: camaleon_cms |
| 3 | +ghsa: 75j2-9gmc-m855 |
| 4 | +url: https://github.com/owen2345/camaleon-cms/security/advisories/GHSA-r9cr-qmfw-pmrc |
| 5 | +title: Camaleon CMS vulnerable to stored XSS through user file |
| 6 | + upload (GHSL-2024-184) |
| 7 | +date: 2024-09-25 |
| 8 | +description: | |
| 9 | + A stored cross-site scripting has been found in the image upload |
| 10 | + functionality that can be used by normal registered users: |
| 11 | + It is possible to upload a SVG image containing JavaScript and it's |
| 12 | + also possible to upload a HTML document when the format parameter |
| 13 | + is manually changed to [documents][1] or a string of an |
| 14 | + [unsupported format][2]. If an authenticated user or administrator |
| 15 | + visits that uploaded image or document malicious JavaScript can be |
| 16 | + executed on their behalf (e.g. changing or deleting content inside |
| 17 | + of the CMS.) |
| 18 | +
|
| 19 | + [1]: https://github.com/owen2345/camaleon-cms/blob/feccb96e542319ed608acd3a16fa5d92f13ede67/app/uploaders/camaleon_cms_uploader.rb#L105-L106 |
| 20 | + [2]: https://github.com/owen2345/camaleon-cms/blob/feccb96e542319ed608acd3a16fa5d92f13ede67/app/uploaders/camaleon_cms_uploader.rb#L110-L111 |
| 21 | +
|
| 22 | + ## Impact |
| 23 | +
|
| 24 | + This issue may lead to account takeover due to reflected Cross-site |
| 25 | + scripting (XSS). |
| 26 | +
|
| 27 | + ## Remediation |
| 28 | +
|
| 29 | + Only allow the upload of safe files such as PNG, TXT and others or |
| 30 | + serve all "unsafe" files such as SVG and other files with a |
| 31 | + content-disposition: attachment header, which should prevent browsers |
| 32 | + from displaying them. |
| 33 | +
|
| 34 | + Additionally, a [Content security policy (CSP)][3] can be created |
| 35 | + that disallows inlined script. (Other parts of the application might |
| 36 | + need modification to continue functioning.) |
| 37 | +
|
| 38 | + [3]: https://web.dev/articles/csp |
| 39 | +
|
| 40 | + To prevent the theft of the auth_token it could be marked with |
| 41 | + HttpOnly. This would however not prevent that actions could be |
| 42 | + performed as the authenticated user/administrator. Furthermore, it |
| 43 | + could make sense to use the authentication provided by Ruby on Rails, |
| 44 | + so that stolen tokens cannot be used anymore after some time. |
| 45 | +cvss_v3: 5.4 |
| 46 | +unaffected_versions: |
| 47 | + - "< 2.8.0" |
| 48 | +patched_versions: |
| 49 | + - ">= 2.8.2" |
| 50 | +related: |
| 51 | + url: |
| 52 | + - https://github.com/owen2345/camaleon-cms/security/advisories/GHSA-r9cr-qmfw-pmrc |
| 53 | + - https://github.com/rubysec/ruby-advisory-db/blob/master/gems/camaleon_cms/GHSA-8fx8-3rg2-79xw.yml |
| 54 | + - https://github.com/advisories/GHSA-75j2-9gmc-m855 |
0 commit comments