Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent specially crafted url strings from being used to access unintended files via an escaped slash character `%2e`
- Loading branch information
Showing
5 changed files
with
31 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 1.0.1 (8/08/2013) | ||
|
||
* Fix security issue #94 | ||
|
||
## 1.0.0 (8/03/2013) | ||
|
||
* Rails 4 compatible tested version released | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
1.0.0 | ||
1.0.1 |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
require 'erb' | ||
|
||
module Wicked | ||
FINISH_STEP = "wicked_finish" | ||
FIRST_STEP = "wicked_first" | ||
|
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,23 @@ | ||
require 'test_helper' | ||
|
||
class SecurityTest < ActiveSupport::IntegrationCase | ||
|
||
test 'does not show database.yml' do | ||
step = "%2E%2F%2E%2E%2F%2E%2E%2Fconfig%2Fdatabase%2Eyml" | ||
assert_raise ActionView::MissingTemplate do | ||
visit(bar_path(step)) | ||
end | ||
refute has_content?('sqlite3') | ||
end | ||
|
||
# only works on *nix systems | ||
test 'does not show arbitrary system file' do | ||
root = '%2E%2F%2E' * 100 # root of system | ||
step = root + '%2Fusr%2Fshare%2Fdict%2Fwords' | ||
|
||
assert_raise ActionView::MissingTemplate do | ||
visit(bar_path(step)) | ||
end | ||
refute has_content?('aardvark') | ||
end | ||
end |