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

False positive - ActionDispatch::Http::UploadedFile #1110

Closed
shaicoleman opened this Issue Oct 11, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@shaicoleman

shaicoleman commented Oct 11, 2017

An uploaded file parameters will return ActionDispatch::Http::UploadedFile
That object and its tempfile should be safe to access, as they are created by Rails, and not directly from user input.

Rails Version: 5.1.4
Brakeman Version: 4.0.1

Confidence: High
Category: File Access
Check: FileAccess
Message: Parameter value used in file name
Code: FileUtils.move(params.permit(:my_upload => ([:upload])).dig("my_upload", "upload").tempfile.path, "/tmp/new_temp_file")
File: app/controllers/uploads_controller.rb
@presidentbeef

This comment has been minimized.

Show comment
Hide comment
@presidentbeef

presidentbeef Nov 3, 2017

Owner

I agree. Will fix.

Owner

presidentbeef commented Nov 3, 2017

I agree. Will fix.

@presidentbeef presidentbeef added this to the 4.0.2 milestone Nov 17, 2017

Repository owner locked and limited conversation to collaborators Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.