Lucene search

K
githubGitHub Advisory DatabaseGHSA-CP65-5M9R-VC2C
HistorySep 18, 2024 - 3:46 p.m.

Camaleon CMS vulnerable to arbitrary path traversal (GHSL-2024-183)

2024-09-1815:46:53
CWE-22
CWE-200
GitHub Advisory Database
github.com
camaleon cms
path traversal
information disclosure
file downloads
security vulnerability

CVSS3

7.7

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

CHANGED

Confidentiality Impact

HIGH

Integrity Impact

NONE

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N

AI Score

6.6

Confidence

High

EPSS

0.001

Percentile

24.9%

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 method:

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 method of the CamaleonCmsLocalUploader class (when files are uploaded locally):

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.

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
OWASP: Path Traversal

Affected configurations

Vulners
Node
tuzitiocamaleon_cmsRange<2.8.1
VendorProductVersionCPE
tuzitiocamaleon_cms*cpe:2.3:a:tuzitio:camaleon_cms:*:*:*:*:*:*:*:*

CVSS3

7.7

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

CHANGED

Confidentiality Impact

HIGH

Integrity Impact

NONE

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N

AI Score

6.6

Confidence

High

EPSS

0.001

Percentile

24.9%

Related for GHSA-CP65-5M9R-VC2C