{"answers":{"affected":"2 open source packages ship an affected version, including camaleon_cms.","exploited":"There is no known exploitation of GHSA-r9cr-qmfw-pmrc in the wild and no public exploit code.","fix":"Upgrade camaleon_cms to 2.8.1 or later.","what":"GHSA-r9cr-qmfw-pmrc is a cross-site scripting vulnerability in camaleon_cms, published on 18 Sep 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for GHSA-r9cr-qmfw-pmrc and fix it if it is affected.\n\nWhat it is: GHSA-r9cr-qmfw-pmrc is a cross-site scripting vulnerability in camaleon_cms, published on 18 Sep 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of GHSA-r9cr-qmfw-pmrc in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- camaleon_cms (RubyGems): affected all versions; fixed in 2.8.1\n- camaleon_cms (RubyGems): affected all versions; fixed in 2.8.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-r9cr-qmfw-pmrc/ (Markdown: https://insights.sbomify.com/GHSA-r9cr-qmfw-pmrc/index.md)","id":"GHSA-r9cr-qmfw-pmrc","markdown":"https://insights.sbomify.com/GHSA-r9cr-qmfw-pmrc/index.md","name":"GHSA-r9cr-qmfw-pmrc","record":{"aliases":[],"analysis":{"component_type":"web_application","fix_type":"patch","impacts":["data_modify","account_takeover"],"network_reachable":"yes","non_default_config":false,"product_category":"Camaleon CMS","requires_auth":"low_privilege","summary":"Authenticated users can upload malicious SVG or HTML files to execute JavaScript in other users' browsers, potentially modifying content or stealing sessions.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"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](https://github.com/owen2345/camaleon-cms/blob/feccb96e542319ed608acd3a16fa5d92f13ede67/app/uploaders/camaleon_cms_uploader.rb#L105-L106) or a string of an [unsupported format](https://github.com/owen2345/camaleon-cms/blob/feccb96e542319ed608acd3a16fa5d92f13ede67/app/uploaders/camaleon_cms_uploader.rb#L110-L111). 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.)\n\nProof of concept\nLogin as a normal user (if user signup is enabled).\nGo to the user's profile.\nAnd upload the following profile picture via drag and drop.\nThe content of the SVG file could be as follows (e.g. name it test-xss.svg):\n\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?\u003e\n\u003csvg\n   xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n   xmlns:cc=\"http://creativecommons.org/ns#\"\n   xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n   xmlns:svg=\"http://www.w3.org/2000/svg\"\n   xmlns=\"http://www.w3.org/2000/svg\"\n   width=\"500\"\n   height=\"500\"\n   viewBox=\"0 0 198.4375 52.916666\"\n   version=\"1.1\"\u003e\n  \u003cg\n     transform=\"translate(-9.8676114,4.8833333)\"\u003e\n    \u003cpath\n       d=\"m 107.79557,-10.430538 -7.33315,-0.02213 -3.647402,-6.361755 3.685742,-6.339624 7.33314,0.02213 3.64741,6.361756 z\"\n       style=\"fill:#131f6b;fill-opacity:1;stroke-width:0.05937638\"\n       transform=\"scale(1,-1)\" /\u003e\n  \u003c!-- The below lines were added in a text editor to the image XML. This is the stored XSS attack. --\u003e\n  \u003cscript type=\"text/javascript\"\u003e\n    alert(\"This is an example of a stored XSS attack in an SVG image, here's the cookie: \" + document.cookie);\n  \u003c/script\u003e\n  \u003c/g\u003e\n\u003c/svg\u003e\nThe server might fail with a 500 internal server error, but the uploaded image should be available at a location like https://\u003ccamaleon-host\u003e/media/1/test-xss-cookie.svg. If an authenticated user or administrator accesses that link their auth_token is reflected. Since the auth_token cookie contains a static [auth token](https://github.com/owen2345/camaleon-cms/blob/feccb96e542319ed608acd3a16fa5d92f13ede67/app/models/concerns/camaleon_cms/user_methods.rb#L18-L19) value that only changes when a user changes their password.\n\nImpact\nThis issue may lead to account takeover due to reflected Cross-site scripting (XSS).\n\nRemediation\nOnly 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.\n\nAdditionally, a [Content security policy (CSP)](https://web.dev/articles/csp) can be created that disallows inlined script. (Other parts of the application might need modification to continue functioning.)\n\nTo 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.","ecosystems":["RubyGems"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Camaleon CMS vulnerable to stored XSS through user file upload (GHSL-2024-184)","id":"GHSA-r9cr-qmfw-pmrc","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"RubyGems","product":null,"products":[],"type":"xss","year":"2024"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"RubyGems","fixed":["2.8.1"],"introduced":["0"],"last_affected":[],"package":"camaleon_cms","purl":null,"source":"GHSA-r9cr-qmfw-pmrc"},{"ecosystem":"RubyGems","fixed":["2.8.1"],"introduced":["0"],"last_affected":[],"package":"camaleon_cms","purl":"pkg:gem/camaleon_cms","source":"GHSA-r9cr-qmfw-pmrc"}],"products":null,"published":"2024-09-18","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Authenticated users can upload malicious SVG or HTML files to execute JavaScript in other users' browsers, potentially modifying content or stealing sessions.","url":"https://insights.sbomify.com/GHSA-r9cr-qmfw-pmrc/"}