Arbitrary file write leading to RCE in Camaleon CMS
Description
Camaleon CMS is a dynamic and advanced content management system based on Ruby on Rails. An arbitrary file write vulnerability accessible via the upload method of the MediaController allows authenticated users to write arbitrary files to any location on the web server Camaleon CMS is running on (depending on the permissions of the underlying filesystem). E.g. This can lead to a delayed remote code execution in case an attacker is able to write a Ruby file into the config/initializers/ subfolder of the Ruby on Rails application. This issue has been addressed in release version 2.8.2. Users are advised to upgrade. There are no known workarounds for this vulnerability.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
camaleon_cmsRubyGems | >= 2.8.0, < 2.8.1 | 2.8.1 |
Affected products
1- Range: < 2.8.2
Patches
1b3b12b1e4a9eFix GHSL-2024-182 - don't allow path traversal on upload_file
2 files changed · +9 −0
app/helpers/camaleon_cms/uploader_helper.rb+3 −0 modified@@ -58,6 +58,9 @@ def upload_file(uploaded_io, settings = {}) hooks_run('before_upload', settings) res = { error: nil } + # guard against path traversal + return { error: 'Invalid file path' } unless cama_uploader.class.valid_folder_path?(settings[:folder]) + # formats validations return { error: "#{ct('file_format_error')} (#{settings[:formats]})" } unless cama_uploader.class.validate_file_format( uploaded_io.path, settings[:formats]
app/uploaders/camaleon_cms_uploader.rb+6 −0 modified@@ -125,6 +125,12 @@ def self.validate_file_format(key, valid_formats = '*') valid_formats.include?(File.extname(key).sub('.', '').split('?').first.try(:downcase)) end + def self.valid_folder_path?(path) + return false if path.include?("..") || File.absolute_path?(path) || path.include?("://") + + true + end + # verify if this file name already exist # if the file is already exist, return a new name for this file # sample: search_new_key("my_file/file.txt")
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
9- github.com/advisories/GHSA-wmjg-vqhv-q5p5ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-46986ghsaADVISORY
- securitylab.github.com/advisories/GHSL-2024-182_GHSL-2024-186_Camaleon_CMSghsax_refsource_MISCADVISORY
- codeql.github.com/codeql-query-help/ruby/rb-path-injectionghsax_refsource_MISCWEB
- github.com/owen2345/camaleon-cms/commit/b3b12b1e4a9e3fccaf5bb4330820fa7f8744e6bdghsaWEB
- github.com/owen2345/camaleon-cms/security/advisories/GHSA-wmjg-vqhv-q5p5ghsax_refsource_CONFIRMWEB
- github.com/rubysec/ruby-advisory-db/blob/master/gems/camaleon_cms/CVE-2024-46986.ymlghsaWEB
- owasp.org/www-community/attacks/Path_Traversalghsax_refsource_MISCWEB
- www.reddit.com/r/rails/comments/1exwtdm/camaleon_cms_281_has_been_releasedghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.