Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding a check for CVE-2014-3483: Ruby on Rails 4.x SQL Injection d…
…ue to PostgreSQL adapter (issue #75)
- Loading branch information
Showing
5 changed files
with
64 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module Codesake | ||
module Dawn | ||
module Kb | ||
# Automatically created with rake on 2014-07-07 | ||
class CVE_2014_3483 | ||
include DependencyCheck | ||
|
||
def initialize | ||
message = "Ruby on Rails contains a flaw that may allow carrying out an SQL injection attack. The issue is due to the PostgreSQL adapter for Active Record not properly sanitizing user-supplied input when quoting ranges. This may allow a remote attacker to inject or manipulate SQL queries in the back-end database, allowing for the manipulation or disclosure of arbitrary data." | ||
super({ | ||
:name=>"CVE-2014-3483", | ||
:cve=>"2014-3483", | ||
:osvdb=>"108665", | ||
:cvss=>"", | ||
:release_date => Date.new(2014, 7, 2), | ||
:cwe=>"", | ||
:owasp=>"A1", | ||
:applies=>["rails"], | ||
:kind=>Codesake::Dawn::KnowledgeBase::DEPENDENCY_CHECK, | ||
:message=>message, | ||
:mitigation=>"Please upgrade rails at least to version 4.0.7 or 4.1.3. As a general rule, using the latest stable rails version is recommended.", | ||
:aux_links=>[""] | ||
}) | ||
self.safe_dependencies = [{:name=>"rails", :version=>['4.0.7', '4.1.3']}] | ||
end | ||
end | ||
end | ||
end | ||
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
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,25 @@ | ||
require 'spec_helper' | ||
describe "The CVE-2014-3483 vulnerability" do | ||
before(:all) do | ||
@check = Codesake::Dawn::Kb::CVE_2014_3483.new | ||
# @check.debug = true | ||
end | ||
it "must be filled with CVSS information" | ||
it "must be filled with auxiliary link" | ||
it "is reported when a rails gem version 4.0.6 is detected" do | ||
@check.dependencies = [{:name=>"rails", :version=>"4.0.6"}] | ||
@check.vuln?.should be_true | ||
end | ||
it "is reported when a rails gem version 4.1.2 is detected" do | ||
@check.dependencies = [{:name=>"rails", :version=>"4.1.2"}] | ||
@check.vuln?.should be_true | ||
end | ||
it "is not reported when a rails gem version 4.0.7 is detected" do | ||
@check.dependencies = [{:name=>"rails", :version=>"4.0.7"}] | ||
@check.vuln?.should be_false | ||
end | ||
it "is not reported when a rails gem version 4.1.3 is detected" do | ||
@check.dependencies = [{:name=>"rails", :version=>"4.1.3"}] | ||
@check.vuln?.should be_false | ||
end | ||
end |