GHSA-8fx8-3rg2-79xw Camaleon CMS vulnerable to stored XSS through user file upload (GHSL-2024-184)
Authenticated users can upload malicious SVG or HTML files to execute JavaScript in victim browsers, potentially leading to account takeover or content modification.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is GHSA-8fx8-3rg2-79xw?
GHSA-8fx8-3rg2-79xw is a cross-site scripting vulnerability in camaleon_cms, published on 23 Sep 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
A stored cross-site scripting has been found in the image upload functionality that can be used by normal registered users: It is possible to upload a SVG image containing JavaScript and it's also possible to upload a HTML document when the format parameter is manually changed to documents or a string of an unsupported format. If an authenticated user or administrator visits that uploaded image or document malicious JavaScript can be executed on their behalf (e.g. changing or deleting content inside of the CMS.)
Impact
This issue may lead to account takeover due to reflected Cross-site scripting (XSS).
Remediation
Only allow the upload of safe files such as PNG, TXT and others or serve all "unsafe" files such as SVG and other files with a content-disposition: attachment header, which should prevent browsers from displaying them.
Additionally, a Content security policy (CSP) can be created that disallows inlined script. (Other parts of the application might need modification to continue functioning.)
To prevent the theft of the auth_token it could be marked with HttpOnly. This would however not prevent that actions could be performed as the authenticated user/administrator. Furthermore, it could make sense to use the authentication provided by Ruby on Rails, so that stolen tokens cannot be used anymore after some time.
Which versions are affected by GHSA-8fx8-3rg2-79xw?
2 open source packages ship an affected version, including camaleon_cms.
| Package | Affected | Fixed in |
|---|---|---|
camaleon_cms RubyGems | All versions | 2.8.1 |
camaleon_cms RubyGems | All versions | 2.8.1 |
How do I fix GHSA-8fx8-3rg2-79xw?
Upgrade camaleon_cms to 2.8.1 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is GHSA-8fx8-3rg2-79xw being exploited?
There is no known exploitation of GHSA-8fx8-3rg2-79xw in the wild and no public exploit code.