VYPR
High severityNVD Advisory· Published Sep 18, 2024· Updated Apr 17, 2025

Arbitrary file write leading to RCE in Camaleon CMS

CVE-2024-46986

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.

PackageAffected versionsPatched versions
camaleon_cmsRubyGems
>= 2.8.0, < 2.8.12.8.1

Affected products

1

Patches

1
b3b12b1e4a9e

Fix 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

News mentions

0

No linked articles in our index yet.