Skip to content

Commit 6b5246f

Browse files
committed
GHSA SYNC: 1 brand new advisory
1 parent 881667a commit 6b5246f

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

gems/camaleon_cms/CVE-2024-46987.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
gem: camaleon_cms
3+
cve: 2024-46987
4+
ghsa: cp65-5m9r-vc2c
5+
url: https://github.com/owen2345/camaleon-cms/security/advisories/GHSA-cp65-5m9r-vc2c
6+
title: Camaleon CMS vulnerable to arbitrary path traversal (GHSL-2024-183)
7+
date: 2024-09-18
8+
description: |
9+
A path traversal vulnerability accessible via MediaController's
10+
download_private_file method allows authenticated users to download
11+
any file on the web server Camaleon CMS is running on (depending
12+
on the file permissions).
13+
14+
In the [download_private_file](https://github.com/owen2345/camaleon-cms/blob/feccb96e542319ed608acd3a16fa5d92f13ede67/app/controllers/camaleon_cms/admin/media_controller.rb#L28)
15+
method:
16+
```ruby
17+
def download_private_file
18+
cama_uploader.enable_private_mode!
19+
20+
file = cama_uploader.fetch_file("private/#{params[:file]}")
21+
22+
send_file file, disposition: 'inline'
23+
end
24+
```
25+
26+
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)
27+
method of the CamaleonCmsLocalUploader class (when files are uploaded locally):
28+
```ruby
29+
def fetch_file(file_name)
30+
raise ActionController::RoutingError, 'File not found' unless file_exists?(file_name)
31+
32+
file_name
33+
end
34+
```
35+
36+
If the file exists it's passed back to the download_private_file method
37+
where the file is sent to the user via
38+
send_file](https://github.com/owen2345/camaleon-cms/blob/feccb96e542319ed608acd3a16fa5d92f13ede67/app/controllers/camaleon_cms/admin/media_controller.rb#L33-L34).
39+
40+
Proof of concept
41+
42+
An authenticated user can download the /etc/passwd file by visiting an URL such as:
43+
44+
https://<camaleon-host>/admin/media/download_private_file?file=../../../../../../etc/passwd
45+
46+
Impact
47+
48+
This issue may lead to Information Disclosure.
49+
50+
Remediation
51+
52+
Normalize file paths constructed from untrusted user input before using
53+
them and check that the resulting path is inside the targeted directory.
54+
Additionally, do not allow character sequences such as .. in untrusted
55+
input that is used to build paths.
56+
57+
See also:
58+
59+
[CodeQL: Uncontrolled data used in path expression](https://codeql.github.com/codeql-query-help/ruby/rb-path-injection/)
60+
[OWASP: Path Traversal](https://owasp.org/www-community/attacks/Path_Traversal)
61+
cvss_v3: 7.7
62+
patched_versions:
63+
- ">= 2.8.1"
64+
related:
65+
url:
66+
- https://nvd.nist.gov/vuln/detail/CVE-2024-46987
67+
- https://github.com/owen2345/camaleon-cms/security/advisories/GHSA-cp65-5m9r-vc2c
68+
- https://github.com/owen2345/camaleon-cms/commit/071b1b09d6d61ab02a5960b1ccafd9d9c2155a3e
69+
- https://codeql.github.com/codeql-query-help/ruby/rb-path-injection
70+
- https://owasp.org/www-community/attacks/Path_Traversal
71+
- https://www.reddit.com/r/rails/comments/1exwtdm/camaleon_cms_281_has_been_released
72+
- https://github.com/advisories/GHSA-cp65-5m9r-vc2c

0 commit comments

Comments
 (0)