Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1619 from presidentbeef/rails_6_sqli_more
SQL injection updates for Rails 6
- Loading branch information
Showing
5 changed files
with
110 additions
and
5 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
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,17 @@ | ||
require_relative '../test' | ||
require 'brakeman/rescanner' | ||
|
||
class Rails61SQLTests < Minitest::Test | ||
include BrakemanTester::RescanTestHelper | ||
|
||
# Test that `pluck`/`order`/`reorder` no longer warn about SQL injection | ||
# in Rails 6.1 | ||
def test_pluck_safe_in_rails_6_1 | ||
before_rescan_of ['app/controllers/groups_controller.rb', 'Gemfile'], 'rails6' do | ||
replace "Gemfile", "gem 'rails', '~> 6.0.0.beta2'", "gem 'rails', '6.1.0'" | ||
end | ||
|
||
assert_equal '6.1.0', @rescanner.tracker.config.rails_version | ||
assert_fixed 3 | ||
end | ||
end |