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 traversal in download_private_file (GHSL-2024-183) #1083

Merged

Conversation

texpert
Copy link
Collaborator

@texpert texpert commented Aug 12, 2024

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

Arbitrary path traversal in download_private_file (GHSL-2024-183) vulnerability reported:

A path traversal vulnerability accessible via MediaController's download_private_file method allows authenticated users to download any file on the web server Camaleon CMS is running on (depending on the file permissions).

This PR fixes the vulnerability by introducing a check in the CamaleonCmsLocalUploader's fetch_file method for the filename to not include ...

Also, changed the exception-based control flow of the fetch_file to just returning errors, because:

@texpert texpert force-pushed the fix-path-traversal-in-download-private-file branch from 795043d to f635218 Compare August 12, 2024 18:37
…ause Rails 7.2 changed the behavior to only report errors that are not considered "handled" based on the `ActionDispatch::ExceptionWrapper.rescue_responses` list (see - rails/rails@a8d1d92)

Also, for the `config.action_dispatch.show_exceptions` behaviour has changed - see rails/rails#50339
@texpert texpert merged commit 071b1b0 into owen2345:master Aug 13, 2024
16 checks passed
@texpert texpert deleted the fix-path-traversal-in-download-private-file branch September 16, 2024 19:06
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