Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mitigate arbitrary path write in uploader (GHSL-2024-182) #1081

Merged

Conversation

texpert
Copy link
Collaborator

@texpert texpert commented Aug 9, 2024

Thanks GHSL team member @p- for disovering and reporting this!

Arbitrary file write to RCE (GHSL-2024-182) vulnerability reported:

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 PR fixes the vulnerability by introducing the CamaleonCmsUploader.valid_folder_path? method which checks for directory traversal path, absolute file path, and URI-like path.

@texpert texpert force-pushed the mitigate-arbitrary-path-write-in-uploader branch from 03e94b3 to 69c0597 Compare August 12, 2024 11:58
@texpert texpert merged commit fa3403a into owen2345:master Aug 12, 2024
@texpert texpert deleted the mitigate-arbitrary-path-write-in-uploader branch September 16, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants