Skip to content

Commit 3d96c5e

Browse files
committed
Ruby: Add test case for rb/insecure-dependency
This tests that we recognise kwargs in hashrocket style: gem "foo", "1.2.3", :git => "..." as well as the modern style: gem "foo", "1.2.3", git: "..."
1 parent 167bda2 commit 3d96c5e

File tree

1 file changed

+6
-0
lines changed
  • ruby/ql/test/query-tests/security/cwe-300

1 file changed

+6
-0
lines changed

ruby/ql/test/query-tests/security/cwe-300/Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ gem "jwt", "1.2.3", git: "ftp://github.com/jwt/ruby-jwt" # $result=BAD
4343
gem "jwt", "1.2.3", git: "ftps://github.com/jwt/ruby-jwt" # GOOD
4444
gem "jwt", "1.2.3", git: "unknown://github.com/jwt/ruby-jwt" # GOOD
4545

46+
gem "jwt", "1.2.3", :git => "https://github.com/jwt/ruby-jwt" # GOOD
47+
gem "jwt", "1.2.3", :git => "http://github.com/jwt/ruby-jwt" # $result=BAD
48+
gem "jwt", "1.2.3", :git => "ftp://github.com/jwt/ruby-jwt" # $result=BAD
49+
gem "jwt", "1.2.3", :git => "ftps://github.com/jwt/ruby-jwt" # GOOD
50+
gem "jwt", "1.2.3", :git => "unknown://github.com/jwt/ruby-jwt" # GOOD
51+
4652
gem "jwt", "1.2.3", source: "https://rubygems.org" # GOOD
4753
gem "jwt", "1.2.3", source: "http://rubygems.org" # $result=BAD
4854
gem "jwt", "1.2.3", source: "ftp://rubygems.org" # $result=BAD

0 commit comments

Comments
 (0)