hpham17/esential-2016

View on GitHub
app/controllers/home_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage

Parameter value used in file name
Open

    File.open(Rails.root.join('public', 'uploads', uploaded_io.original_filename), 'wb') do |file|
Severity: Minor
Found in app/controllers/home_controller.rb by brakeman

Using user input when accessing files (local or remote) will raise a warning in Brakeman.

For example

File.open("/tmp/#{cookie[:file]}")

will raise an error like

Cookie value used in file name near line 4: File.open("/tmp/#{cookie[:file]}")

This type of vulnerability can be used to access arbitrary files on a server (including /etc/passwd.

There are no issues that match your filters.

Category
Status