Skip to content

Commit 07765d7

Browse files
jasnowRubySec CI
authored and
RubySec CI
committed
Updated advisory posts against rubysec/ruby-advisory-db@6f90c48
1 parent 16a9a73 commit 07765d7

File tree

1 file changed

+86
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)