GHSA-r9cr-qmfw-pmrc: Camaleon cms Cross-Site Scripting Vulnerability

MODERATE
CVSS 5.4
CWE-79
Published
Advisory Summary

GHSA-r9cr-qmfw-pmrc is a MODERATE (CVSS 5.4) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Camaleon cms libraries in the RubyGems ecosystem. The issue involves camaleon cms vulnerable to stored xss through user file upload (ghsl-2024-184). Remediation is available by upgrading affected packages to version 2.8.1.

GHSA-r9cr-qmfw-pmrc at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-r9cr-qmfw-pmrc
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Camaleon cms
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 5.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-r9cr-qmfw-pmrc

To remediate this vulnerability, upgrade all affected Camaleon cms dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

camaleon_cms fixed: 2.8.1
Upgrade camaleon_cms to 2.8.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for camaleon_cms

How to Check if You Are Affected

To determine whether your application is affected by GHSA-r9cr-qmfw-pmrc, inspect your project dependencies for Camaleon cms:

inspect dependencies for camaleon_cms

Analyze the terminal output to locate any version of Camaleon cms in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.8.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Camaleon cms, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.) Proof of concept Login as a normal user (if user signup is enabled). Go to the user's profile. And upload the following profile picture via drag and drop. The content of the SVG file could be as follows (e.g. name it test-xss.svg): <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="500" height="500" viewBox="0 0 198.4375 52.916666" version="1.1"> <g transform="translate(-9.8676114,4.8833333)"> <path 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" style="fill:#131f6b;fill-opacity:1;stroke-width:0.05937638" transform="scale(1,-1)" /> <!-- The below lines were added in a text editor to the image XML. This is the stored XSS attack. --> <script type="text/javascript"> alert("This is an example of a stored XSS attack in an SVG image, here's the cookie: " + document.cookie); </script> </g> </svg> The server might fail with a 500 internal server error, but the uploaded image should be available at a location like https://<camaleon-host>/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. 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)](https://web.dev/articles/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.

GHSA-r9cr-qmfw-pmrc Affected Camaleon cms Versions

1 component(s)
Fixed Versions:
2.8.1
Product / Package Ecosystem Affected Versions Fixed Version
camaleon_cms
RubyGems
< 2.8.1
2.8.1

References

Frequently Asked Questions

What is GHSA-r9cr-qmfw-pmrc?
GHSA-r9cr-qmfw-pmrc is a security vulnerability in Camaleon cms involving Camaleon CMS vulnerable to stored XSS through user file upload (GHSL-2024-184) under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Camaleon cms versions are affected?
Affected versions include releases prior to 2.8.1 across affected packages: camaleon_cms.
What version fixes GHSA-r9cr-qmfw-pmrc?
Upgrading to 2.8.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is camaleon_cms affected?
Yes, camaleon_cms is affected in releases prior to 2.8.1. Upgrade your dependency to 2.8.1 or later.
What is the CVSS score of GHSA-r9cr-qmfw-pmrc?
GHSA-r9cr-qmfw-pmrc has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with GHSA-r9cr-qmfw-pmrc?
GHSA-r9cr-qmfw-pmrc is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check RubyGems dependencies for GHSA-r9cr-qmfw-pmrc?
Run the dependency tree command: 'inspect dependencies for camaleon_cms'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-r9cr-qmfw-pmrc",
  "modified" : "2024-09-18T15:47:57Z",
  "published" : "2024-09-18T15:47:01Z",
  "aliases" : [ ],
  "summary" : "Camaleon CMS vulnerable to stored XSS through user file upload (GHSL-2024-184)",
  "details" : "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<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<svg\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\">\n  <g\n     transform=\"translate(-9.8676114,4.8833333)\">\n    <path\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)\" />\n  <!-- The below lines were added in a text editor to the image XML. This is the stored XSS attack. -->\n  <script type=\"text/javascript\">\n    alert(\"This is an example of a stored XSS attack in an SVG image, here's the cookie: \" + document.cookie);\n  </script>\n  </g>\n</svg>\nThe server might fail with a 500 internal server error, but the uploaded image should be available at a location like https://<camaleon-host>/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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "camaleon_cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.8.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/owen2345/camaleon-cms/security/advisories/GHSA-r9cr-qmfw-pmrc"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/owen2345/camaleon-cms/commit/b18fbc74f3ecd98a1f781d015f5466ef16b1425b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/owen2345/camaleon-cms"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-09-18T15:47:01Z",
    "nvd_published_at" : null
  }
}