diff --git a/Gemfile b/Gemfile index 131581f..219755b 100755 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,8 @@ source 'https://rubygems.org' -gem 'rails', '3.2.15' +#don't upgrade +gem 'rails', '3.2.11' +gem 'rack', '1.4.3' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' diff --git a/Gemfile.lock b/Gemfile.lock index aed7bd1..4c937ea 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,32 +1,32 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (3.2.15) - actionpack (= 3.2.15) - mail (~> 2.5.4) - actionpack (3.2.15) - activemodel (= 3.2.15) - activesupport (= 3.2.15) + actionmailer (3.2.11) + actionpack (= 3.2.11) + mail (~> 2.4.4) + actionpack (3.2.11) + activemodel (= 3.2.11) + activesupport (= 3.2.11) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) - rack (~> 1.4.5) + rack (~> 1.4.0) rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.2.1) - activemodel (3.2.15) - activesupport (= 3.2.15) + activemodel (3.2.11) + activesupport (= 3.2.11) builder (~> 3.0.0) - activerecord (3.2.15) - activemodel (= 3.2.15) - activesupport (= 3.2.15) + activerecord (3.2.11) + activemodel (= 3.2.11) + activesupport (= 3.2.11) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activeresource (3.2.15) - activemodel (= 3.2.15) - activesupport (= 3.2.15) - activesupport (3.2.15) - i18n (~> 0.6, >= 0.6.4) + activeresource (3.2.11) + activemodel (= 3.2.11) + activesupport (= 3.2.11) + activesupport (3.2.11) + i18n (~> 0.6) multi_json (~> 1.0) addressable (2.3.5) arel (3.0.2) @@ -52,7 +52,7 @@ GEM slim (>= 1.3.6, < 3.0) terminal-table (~> 1.4) builder (3.0.4) - bundler-audit (0.2.0) + bundler-audit (0.3.0) bundler (~> 1.2) capybara (2.1.0) mime-types (>= 1.16) @@ -73,15 +73,15 @@ GEM coffee-script-source execjs coffee-script-source (1.6.3) - cucumber (1.3.8) + cucumber (1.3.9) builder (>= 2.1.2) diff-lcs (>= 1.1.3) - gherkin (~> 2.12.1) + gherkin (~> 2.12) multi_json (>= 1.7.5, < 2.0) multi_test (>= 0.0.2) database_cleaner (1.0.1) debug_inspector (0.0.2) - diff-lcs (1.2.4) + diff-lcs (1.2.5) docile (1.1.0) dotenv (0.9.0) em-websocket (0.5.0) @@ -91,10 +91,11 @@ GEM eventmachine (1.0.3) execjs (2.0.2) fastercsv (1.5.5) - ffi (1.9.0) + ffi (1.9.3) foreman (0.63.0) dotenv (>= 0.7) thor (>= 0.13.6) + formatador (0.2.4) gauntlt (1.0.6) aruba cucumber @@ -102,22 +103,25 @@ GEM trollop gherkin (2.12.2) multi_json (~> 1.3) - guard (1.4.0) - listen (>= 0.4.2) - thor (>= 0.14.6) + guard (2.2.3) + formatador (>= 0.2.4) + listen (~> 2.1) + lumberjack (~> 1.0) + pry (>= 0.9.12) + thor (>= 0.18.1) guard-brakeman (0.8.1) brakeman (>= 2.1.1) guard (>= 1.1.0) - guard-livereload (1.0.3) - em-websocket (>= 0.2.0) - guard (>= 1.1.0) - multi_json (~> 1.0) - guard-rspec (2.5.4) - guard (>= 1.1) - rspec (~> 2.11) + guard-livereload (2.0.0) + em-websocket (~> 0.5) + guard (~> 2.0) + multi_json (~> 1.8) + guard-rspec (4.0.4) + guard (>= 2.1.1) + rspec (~> 2.14) guard-shell (0.5.1) guard (>= 1.1.0) - haml (4.0.3) + haml (4.0.4) tilt hashr (0.0.22) highline (1.6.20) @@ -133,15 +137,17 @@ GEM thor (>= 0.14, < 2.0) json (1.8.1) kgio (2.8.1) - launchy (2.3.0) + launchy (2.4.0) addressable (~> 2.3) libv8 (3.16.14.3) - listen (2.1.2) + listen (2.2.0) celluloid (>= 0.15.2) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) lockfile (2.1.0) - mail (2.5.4) + lumberjack (1.0.4) + mail (2.4.4) + i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) method_source (0.8.2) @@ -157,12 +163,11 @@ GEM polyglot (0.3.3) powder (0.2.0) thor (>= 0.11.5) - pry (0.9.6) - coderay (>= 0.9.8) - method_source (>= 0.6.5) - ruby_parser (>= 2.0.5) - slop (~> 2.1.0) - rack (1.4.5) + pry (0.9.12.3) + coderay (~> 1.0) + method_source (~> 0.8) + slop (~> 3.4) + rack (1.4.3) rack-cache (1.2) rack (>= 0.4) rack-livereload (0.3.15) @@ -171,17 +176,17 @@ GEM rack rack-test (0.6.2) rack (>= 1.0) - rails (3.2.15) - actionmailer (= 3.2.15) - actionpack (= 3.2.15) - activerecord (= 3.2.15) - activeresource (= 3.2.15) - activesupport (= 3.2.15) + rails (3.2.11) + actionmailer (= 3.2.11) + actionpack (= 3.2.11) + activerecord (= 3.2.11) + activeresource (= 3.2.11) + activesupport (= 3.2.11) bundler (~> 1.0) - railties (= 3.2.15) - railties (3.2.15) - actionpack (= 3.2.15) - activesupport (= 3.2.15) + railties (= 3.2.11) + railties (3.2.11) + actionpack (= 3.2.11) + activesupport (= 3.2.11) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) @@ -198,8 +203,8 @@ GEM rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) rspec-mocks (~> 2.14.0) - rspec-core (2.14.6) - rspec-expectations (2.14.3) + rspec-core (2.14.7) + rspec-expectations (2.14.4) diff-lcs (>= 1.1.3, < 2.0) rspec-mocks (2.14.4) rspec-rails (2.14.0) @@ -229,7 +234,7 @@ GEM slim (2.0.2) temple (~> 0.6.6) tilt (>= 1.3.3, < 2.1) - slop (2.1.0) + slop (3.4.6) sprockets (2.2.2) hike (~> 1.2) multi_json (~> 1.0) @@ -251,10 +256,10 @@ GEM polyglot (>= 0.3.1) trollop (2.0) tzinfo (0.3.38) - uglifier (2.3.0) + uglifier (2.3.1) execjs (>= 0.3.0) json (>= 1.8.0) - unicorn (4.6.3) + unicorn (4.7.0) kgio (~> 2.6) rack raindrops (~> 0.7) @@ -288,8 +293,9 @@ DEPENDENCIES poltergeist powder pry + rack (= 1.4.3) rack-livereload - rails (= 3.2.15) + rails (= 3.2.11) rb-fsevent rspec-rails sass-rails diff --git a/app/controllers/tutorials_controller.rb b/app/controllers/tutorials_controller.rb index f88edba..fb4d61d 100755 --- a/app/controllers/tutorials_controller.rb +++ b/app/controllers/tutorials_controller.rb @@ -15,7 +15,6 @@ class TutorialsController < ApplicationController end def injection - end def xss @@ -62,6 +61,9 @@ class TutorialsController < ApplicationController def misconfig end + + def insecure_components + end def crypto end diff --git a/app/views/layouts/tutorial/_sidebar.html.erb b/app/views/layouts/tutorial/_sidebar.html.erb index 241339c..10e885f 100755 --- a/app/views/layouts/tutorial/_sidebar.html.erb +++ b/app/views/layouts/tutorial/_sidebar.html.erb @@ -74,7 +74,7 @@ <% end %>
- The Railsgoat application stores Social Security Numbers in plain-text and because of this, it fails to adequately protect these numbers from theft. + The Railsgoat application stores and transmits Social Security Numbers insecurely.
- The WorkInfo model (app/models/work_info.rb) is where the code to encrypt this data should be. However, as seen, is missing any routine to do so. +
+ The Railsgoat application stores user's Social Security Numbers in plain-text within the database and because of this, it fails to adequately protect these numbers from theft. Additionally, the user's full SSN is sent back to the user within an HTTP response from the application. +
++ The WorkInfo model (app/models/work_info.rb) is missing code to encrypt this data prior to storage. Additionally, while code exists to render only the last 4 numbers of an SSN, at no time is it used.
class WorkInfo < ActiveRecord::Base diff --git a/app/views/layouts/tutorial/insecure_components/_insecure_components_first.html.erb b/app/views/layouts/tutorial/insecure_components/_insecure_components_first.html.erb new file mode 100644 index 0000000..b5192d5 --- /dev/null +++ b/app/views/layouts/tutorial/insecure_components/_insecure_components_first.html.erb @@ -0,0 +1,81 @@ + \ No newline at end of file diff --git a/app/views/layouts/tutorial/misconfig/_misconfig_first.html.erb b/app/views/layouts/tutorial/misconfig/_misconfig_first.html.erb index 4c2bdc6..076fab2 100755 --- a/app/views/layouts/tutorial/misconfig/_misconfig_first.html.erb +++ b/app/views/layouts/tutorial/misconfig/_misconfig_first.html.erb @@ -16,7 +16,7 @@
Rails has quite a few security related configurations. One of which relates to enforcing mass assignment protection.
+
+
+ <%= %q{
+ config.active_record.whitelist_attributes=false
+ } %>
+
+
+ This configuration forces an application developer to whitelist attributes that can be modified with mass-assignment. When this configuration is set to false any attribute can be mass-assigned.
+ <%= %q{
+ config.active_record.whitelist_attributes=true
+ } %>
+
+ Once this configuration is updated to true and the application is restarted, any attributes to be mass-assigned will have to be defined as attr_accessible.
+