-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HOTFIX : Another vulnerability picked up by Brakeman
- Potential Path Traversal attack (tested working !) I could potentially explore the whole filesystem with root access (Ex: filename: '../../../etc/passwd') - Added (empty) specs to detect it
- Loading branch information
1 parent
988a692
commit 0d20362
Showing
4 changed files
with
31 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require 'spec_helper' | ||
|
||
describe UploadedFilesController, type: :controller do | ||
it 'has a valid factory' do | ||
expect( FactoryGirl.create(:uploaded_file)).to be_valid | ||
end | ||
|
||
it 'does not accept relative paths in file name' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require 'faker' | ||
|
||
FactoryGirl.define do | ||
factory :uploaded_file do |f| | ||
f.name 'hello.png' | ||
end | ||
|
||
factory :dangerous_file, class: UploadedFile do |f| | ||
f.name '../Hello.png' | ||
end | ||
end |