CVE-2024-46987: Camaleon cms Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-cp65-5m9r-vc2c
CVSS 6.5
CWE-200 CWE-22
Published
Advisory Summary

CVE-2024-46987 is a HIGH (CVSS 6.5) path traversal vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Camaleon cms libraries in the RubyGems ecosystem. The issue involves camaleon cms vulnerable to arbitrary path traversal (ghsl-2024-183). Remediation is available by upgrading affected packages to version 2.8.1.

CVE-2024-46987 at a Glance

CVE Identifier CVE-2024-46987
GHSA Identifier GHSA-cp65-5m9r-vc2c
Severity HIGH
CVSS v3.1 Base Score 6.5
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Camaleon cms
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:N/S:U/C:H/I:N/A:N).

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

How to Fix CVE-2024-46987

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 CVE-2024-46987, 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-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. 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 path traversal vulnerability accessible via MediaController's download_private_file method allows authenticated users to download any file on the web server Camaleon CMS is running on (depending on the file permissions). In the [download_private_file](https://github.com/owen2345/camaleon-cms/blob/feccb96e542319ed608acd3a16fa5d92f13ede67/app/controllers/camaleon_cms/admin/media_controller.rb#L28) method: ```ruby def download_private_file cama_uploader.enable_private_mode! file = cama_uploader.fetch_file("private/#{params[:file]}") send_file file, disposition: 'inline' end ``` The file parameter is passed to the [fetch_file](https://github.com/owen2345/camaleon-cms/blob/feccb96e542319ed608acd3a16fa5d92f13ede67/app/uploaders/camaleon_cms_local_uploader.rb#L27) method of the CamaleonCmsLocalUploader class (when files are uploaded locally): ```ruby def fetch_file(file_name) raise ActionController::RoutingError, 'File not found' unless file_exists?(file_name) file_name end ``` If the file exists it's passed back to the download_private_file method where the file is sent to the user via [send_file](https://github.com/owen2345/camaleon-cms/blob/feccb96e542319ed608acd3a16fa5d92f13ede67/app/controllers/camaleon_cms/admin/media_controller.rb#L33-L34). Proof of concept An authenticated user can download the /etc/passwd file by visiting an URL such as: https://<camaleon-host>/admin/media/download_private_file?file=../../../../../../etc/passwd Impact This issue may lead to Information Disclosure. Remediation Normalize file paths constructed from untrusted user input before using them and check that the resulting path is inside the targeted directory. Additionally, do not allow character sequences such as .. in untrusted input that is used to build paths. See also: [CodeQL: Uncontrolled data used in path expression](https://codeql.github.com/codeql-query-help/ruby/rb-path-injection/) [OWASP: Path Traversal](https://owasp.org/www-community/attacks/Path_Traversal)

CVE-2024-46987 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 CVE-2024-46987?
CVE-2024-46987 is a security vulnerability in Camaleon cms involving Camaleon CMS vulnerable to arbitrary path traversal (GHSL-2024-183) under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Camaleon cms versions are affected?
Affected versions include releases prior to 2.8.1 across affected packages: camaleon_cms.
What version fixes CVE-2024-46987?
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 CVE-2024-46987?
CVE-2024-46987 has a CVSS v3.1 base score of 6.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2024-46987?
CVE-2024-46987 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check RubyGems dependencies for CVE-2024-46987?
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-cp65-5m9r-vc2c",
  "modified" : "2025-04-17T23:00:53Z",
  "published" : "2024-09-18T15:46:53Z",
  "aliases" : [ "CVE-2024-46987" ],
  "summary" : "Camaleon CMS vulnerable to arbitrary path traversal (GHSL-2024-183)",
  "details" : "A path traversal vulnerability accessible via MediaController's download_private_file method allows authenticated users to download any file on the web server Camaleon CMS is running on (depending on the file permissions).\n\nIn the [download_private_file](https://github.com/owen2345/camaleon-cms/blob/feccb96e542319ed608acd3a16fa5d92f13ede67/app/controllers/camaleon_cms/admin/media_controller.rb#L28) method:\n```ruby\ndef download_private_file\n  cama_uploader.enable_private_mode!\n\n  file = cama_uploader.fetch_file(\"private/#{params[:file]}\")\n\n  send_file file, disposition: 'inline'\nend\n```\nThe file parameter is passed to the [fetch_file](https://github.com/owen2345/camaleon-cms/blob/feccb96e542319ed608acd3a16fa5d92f13ede67/app/uploaders/camaleon_cms_local_uploader.rb#L27) method of the CamaleonCmsLocalUploader class (when files are uploaded locally):\n```ruby\ndef fetch_file(file_name)\n  raise ActionController::RoutingError, 'File not found' unless file_exists?(file_name)\n\n  file_name\nend\n```\nIf the file exists it's passed back to the download_private_file method where the file is sent to the user via [send_file](https://github.com/owen2345/camaleon-cms/blob/feccb96e542319ed608acd3a16fa5d92f13ede67/app/controllers/camaleon_cms/admin/media_controller.rb#L33-L34).\n\nProof of concept\nAn authenticated user can download the /etc/passwd file by visiting an URL such as:\n\nhttps://<camaleon-host>/admin/media/download_private_file?file=../../../../../../etc/passwd\nImpact\nThis issue may lead to Information Disclosure.\n\nRemediation\nNormalize file paths constructed from untrusted user input before using them and check that the resulting path is inside the targeted directory. Additionally, do not allow character sequences such as .. in untrusted input that is used to build paths.\n\nSee also:\n\n[CodeQL: Uncontrolled data used in path expression](https://codeql.github.com/codeql-query-help/ruby/rb-path-injection/)\n[OWASP: Path Traversal](https://owasp.org/www-community/attacks/Path_Traversal)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/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-cp65-5m9r-vc2c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-46987"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/owen2345/camaleon-cms/commit/071b1b09d6d61ab02a5960b1ccafd9d9c2155a3e"
  }, {
    "type" : "WEB",
    "url" : "https://codeql.github.com/codeql-query-help/ruby/rb-path-injection"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/owen2345/camaleon-cms"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/camaleon_cms/CVE-2024-46987.yml"
  }, {
    "type" : "WEB",
    "url" : "https://owasp.org/www-community/attacks/Path_Traversal"
  }, {
    "type" : "ADVISORY",
    "url" : "https://securitylab.github.com/advisories/GHSL-2024-182_GHSL-2024-186_Camaleon_CMS"
  }, {
    "type" : "WEB",
    "url" : "https://www.reddit.com/r/rails/comments/1exwtdm/camaleon_cms_281_has_been_released"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-09-18T15:46:53Z",
    "nvd_published_at" : "2024-09-18T18:15:07Z"
  }
}