From 45cac913ff8c4a805c8fa38ac8dd04e071964a96 Mon Sep 17 00:00:00 2001 From: Al Snow Date: Sun, 20 Oct 2013 10:42:30 -0400 Subject: [PATCH 01/23] Upgraded Rails from 3.2.13 to 3.2.15. Removed unneeded "~>" gem numbers in Gemfile. --- Gemfile | 8 +-- Gemfile.lock | 195 ++++++++++++++++++++++++++------------------------- 2 files changed, 105 insertions(+), 98 deletions(-) mode change 100755 => 100644 Gemfile.lock diff --git a/Gemfile b/Gemfile index b07d1c3..c3836db 100755 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'rails', '3.2.13' +gem 'rails', '3.2.15' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' @@ -37,13 +37,13 @@ end # Gems used only for assets and not required # in production environments by default. group :assets do - gem 'sass-rails', '~> 3.2.3' - gem 'coffee-rails', '~> 3.2.1' + gem 'sass-rails' + gem 'coffee-rails' gem 'jquery-fileupload-rails' # See https://github.com/sstephenson/execjs#readme for more supported runtimes # gem 'therubyracer', :platforms => :ruby - gem 'uglifier', '>= 1.0.3' + gem 'uglifier' end diff --git a/Gemfile.lock b/Gemfile.lock old mode 100755 new mode 100644 index 66398cd..92d0f04 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,12 +1,12 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (3.2.13) - actionpack (= 3.2.13) - mail (~> 2.5.3) - actionpack (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) + actionmailer (3.2.15) + actionpack (= 3.2.15) + mail (~> 2.5.4) + actionpack (3.2.15) + activemodel (= 3.2.15) + activesupport (= 3.2.15) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) @@ -14,19 +14,19 @@ GEM rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.2.1) - activemodel (3.2.13) - activesupport (= 3.2.13) + activemodel (3.2.15) + activesupport (= 3.2.15) builder (~> 3.0.0) - activerecord (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) + activerecord (3.2.15) + activemodel (= 3.2.15) + activesupport (= 3.2.15) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activeresource (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - activesupport (3.2.13) - i18n (= 0.6.1) + activeresource (3.2.15) + activemodel (= 3.2.15) + activesupport (= 3.2.15) + activesupport (3.2.15) + i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) addressable (2.3.5) arel (3.0.2) @@ -34,25 +34,25 @@ GEM childprocess (>= 0.3.6) cucumber (>= 1.1.1) rspec-expectations (>= 2.7.0) - bcrypt-ruby (3.0.1) + bcrypt-ruby (3.1.2) better_errors (1.0.1) coderay (>= 1.0.0) erubis (>= 2.6.6) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - brakeman (1.9.5) + brakeman (2.1.2) erubis (~> 2.6) fastercsv (~> 1.5) haml (>= 3.0, < 5.0) - highline (~> 1.6) + highline (~> 1.6.19) multi_json (~> 1.2) - ruby2ruby (= 2.0.3) - ruby_parser (~> 3.1.1) + ruby2ruby (~> 2.0.5) + ruby_parser (~> 3.2.2) sass (~> 3.0) - slim (~> 1.3.6) + slim (>= 1.3.6, < 3.0) terminal-table (~> 1.4) builder (3.0.4) - bundler-audit (0.1.2) + bundler-audit (0.2.0) bundler (~> 1.2) capybara (2.1.0) mime-types (>= 1.16) @@ -60,89 +60,92 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) + celluloid (0.15.2) + timers (~> 1.1.0) childprocess (0.3.9) ffi (~> 1.0, >= 1.0.11) cliver (0.2.2) - coderay (1.0.9) + coderay (1.1.0) coffee-rails (3.2.2) coffee-script (>= 2.2.0) railties (~> 3.2.0) coffee-script (2.2.0) coffee-script-source execjs - coffee-script-source (1.6.2) - cucumber (1.3.2) + coffee-script-source (1.6.3) + cucumber (1.3.8) builder (>= 2.1.2) diff-lcs (>= 1.1.3) - gherkin (~> 2.12.0) - multi_json (~> 1.3) + gherkin (~> 2.12.1) + 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) + dotenv (0.9.0) em-websocket (0.5.0) eventmachine (>= 0.12.9) http_parser.rb (~> 0.5.3) erubis (2.7.0) eventmachine (1.0.3) - execjs (1.4.0) - multi_json (~> 1.0) + execjs (2.0.2) fastercsv (1.5.5) ffi (1.9.0) - foreman (0.62.0) + foreman (0.63.0) + dotenv (>= 0.7) thor (>= 0.13.6) - formatador (0.2.4) - gauntlt (1.0.5) + gauntlt (1.0.6) + aruba cucumber nokogiri (~> 1.5.0) trollop - gherkin (2.12.0) + gherkin (2.12.2) multi_json (~> 1.3) - guard (1.7.0) - formatador (>= 0.2.4) - listen (>= 0.6.0) - lumberjack (>= 1.0.2) - pry (>= 0.9.10) + guard (1.4.0) + listen (>= 0.4.2) thor (>= 0.14.6) - guard-brakeman (0.6.3) - brakeman (>= 1.8.2) + guard-brakeman (0.8.1) + brakeman (>= 2.1.1) guard (>= 1.1.0) - guard-livereload (1.3.0) + guard-livereload (1.0.3) em-websocket (>= 0.2.0) - guard (>= 1.5.0) + guard (>= 1.1.0) multi_json (~> 1.0) guard-rspec (2.5.4) guard (>= 1.1) rspec (~> 2.11) guard-shell (0.5.1) guard (>= 1.1.0) - haml (4.0.2) + haml (4.0.3) tilt hashr (0.0.22) - highline (1.6.16) - hike (1.2.2) + highline (1.6.20) + hike (1.2.3) http_parser.rb (0.5.3) - i18n (0.6.1) + i18n (0.6.5) journey (1.0.4) jquery-fileupload-rails (0.4.1) actionpack (>= 3.1) railties (>= 3.1) - jquery-rails (3.0.1) + jquery-rails (3.0.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - json (1.7.7) - kgio (2.8.0) + json (1.8.1) + kgio (2.8.1) launchy (2.3.0) addressable (~> 2.3) libv8 (3.16.14.3) - listen (0.7.3) - lumberjack (1.0.3) - mail (2.5.3) - i18n (>= 0.4.0) + listen (2.1.1) + celluloid (>= 0.15.2) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9) + mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) - method_source (0.8.1) - mime-types (1.22) - multi_json (1.7.2) + method_source (0.8.2) + mime-types (1.25) + multi_json (1.8.2) + multi_test (0.0.2) nokogiri (1.5.10) poltergeist (1.4.1) capybara (~> 2.1.0) @@ -152,10 +155,11 @@ GEM polyglot (0.3.3) powder (0.2.0) thor (>= 0.11.5) - pry (0.9.12) - coderay (~> 1.0.5) - method_source (~> 0.8) - slop (~> 3.4) + 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) rack-cache (1.2) rack (>= 0.4) @@ -165,24 +169,26 @@ GEM rack rack-test (0.6.2) rack (>= 1.0) - rails (3.2.13) - actionmailer (= 3.2.13) - actionpack (= 3.2.13) - activerecord (= 3.2.13) - activeresource (= 3.2.13) - activesupport (= 3.2.13) + rails (3.2.15) + actionmailer (= 3.2.15) + actionpack (= 3.2.15) + activerecord (= 3.2.15) + activeresource (= 3.2.15) + activesupport (= 3.2.15) bundler (~> 1.0) - railties (= 3.2.13) - railties (3.2.13) - actionpack (= 3.2.13) - activesupport (= 3.2.13) + railties (= 3.2.15) + railties (3.2.15) + actionpack (= 3.2.15) + activesupport (= 3.2.15) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - raindrops (0.10.0) + raindrops (0.12.0) rake (10.1.0) rb-fsevent (0.9.3) + rb-inotify (0.9.2) + ffi (>= 0.5.0) rdoc (3.12.2) json (~> 1.4) ref (1.0.5) @@ -190,10 +196,10 @@ GEM rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) rspec-mocks (~> 2.14.0) - rspec-core (2.14.2) - rspec-expectations (2.14.0) + rspec-core (2.14.6) + rspec-expectations (2.14.3) diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.14.1) + rspec-mocks (2.14.4) rspec-rails (2.14.0) actionpack (>= 3.0) activesupport (>= 3.0) @@ -201,45 +207,46 @@ GEM rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) rspec-mocks (~> 2.14.0) - ruby2ruby (2.0.3) + ruby2ruby (2.0.6) ruby_parser (~> 3.1) sexp_processor (~> 4.0) - ruby_parser (3.1.3) + ruby_parser (3.2.2) sexp_processor (~> 4.1) - sass (3.2.7) + sass (3.2.12) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - sexp_processor (4.2.1) - slim (1.3.8) - temple (~> 0.6.3) - tilt (~> 1.3.3) - slop (3.4.4) + sexp_processor (4.4.0) + slim (2.0.1) + temple (~> 0.6.6) + tilt (>= 1.3.3, < 2.1) + slop (2.1.0) sprockets (2.2.2) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.7) - temple (0.6.3) + sqlite3 (1.3.8) + temple (0.6.7) terminal-table (1.4.5) therubyracer (0.12.0) libv8 (~> 3.16.14.0) ref thor (0.18.1) - tilt (1.3.7) + tilt (1.4.1) + timers (1.1.0) travis-lint (1.7.0) hashr (~> 0.0.22) - treetop (1.4.12) + treetop (1.4.15) polyglot polyglot (>= 0.3.1) trollop (2.0) - tzinfo (0.3.37) - uglifier (2.0.1) + tzinfo (0.3.38) + uglifier (2.2.1) execjs (>= 0.3.0) multi_json (~> 1.0, >= 1.0.2) - unicorn (4.6.2) + unicorn (4.6.3) kgio (~> 2.6) rack raindrops (~> 0.7) @@ -258,7 +265,7 @@ DEPENDENCIES brakeman bundler-audit capybara - coffee-rails (~> 3.2.1) + coffee-rails database_cleaner (< 1.1.0) execjs foreman @@ -274,12 +281,12 @@ DEPENDENCIES powder pry rack-livereload - rails (= 3.2.13) + rails (= 3.2.15) rb-fsevent rspec-rails - sass-rails (~> 3.2.3) + sass-rails sqlite3 therubyracer travis-lint - uglifier (>= 1.0.3) + uglifier unicorn From f8ab8c320ce33eb4731d770ab323369f49e2c3be Mon Sep 17 00:00:00 2001 From: Al Snow Date: Sun, 20 Oct 2013 11:59:23 -0400 Subject: [PATCH 02/23] Upgraded Ruby to 2.0.0. --- .rvmrc | 2 +- .travis.yml | 4 ++-- Gemfile | 2 ++ Gemfile.lock | 8 +++++++- README.md | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.rvmrc b/.rvmrc index bf053af..8adb56f 100755 --- a/.rvmrc +++ b/.rvmrc @@ -1 +1 @@ -rvm use 1.9.3@railsgoat --create +rvm use 2.0.0@railsgoat --create diff --git a/.travis.yml b/.travis.yml index 4ae7691..db3f911 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: ruby rvm: - - "1.9.3" + - "2.0.0" before_script: rake db:setup -env: RAILSGOAT_MAINTAINER=true \ No newline at end of file +env: RAILSGOAT_MAINTAINER=true diff --git a/Gemfile b/Gemfile index c3836db..8e53c26 100755 --- a/Gemfile +++ b/Gemfile @@ -32,6 +32,8 @@ group :development, :test do gem 'database_cleaner', '< 1.1.0' gem 'poltergeist' gem 'rspec-rails' + gem 'simple_cov' + gem 'simplecov', :require => false end # Gems used only for assets and not required diff --git a/Gemfile.lock b/Gemfile.lock index 92d0f04..ed5c636 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -95,7 +95,6 @@ GEM dotenv (>= 0.7) thor (>= 0.13.6) gauntlt (1.0.6) - aruba cucumber nokogiri (~> 1.5.0) trollop @@ -218,6 +217,11 @@ GEM sass (>= 3.1.10) tilt (~> 1.3) sexp_processor (4.4.0) + simple_cov (0.2.0) + simplecov (0.7.1) + multi_json (~> 1.0) + simplecov-html (~> 0.7.1) + simplecov-html (0.7.1) slim (2.0.1) temple (~> 0.6.6) tilt (>= 1.3.3, < 2.1) @@ -285,6 +289,8 @@ DEPENDENCIES rb-fsevent rspec-rails sass-rails + simple_cov + simplecov sqlite3 therubyracer travis-lint diff --git a/README.md b/README.md index 850287c..d951f4c 100755 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ cd railsgoat - rvm use 1.9.3@railsgoat --create # https://rvm.io/ + rvm use 2.0.0@railsgoat --create # https://rvm.io/ bundle From 6fa175ac61cc26e06cae7a1b642a2b1cb7a7d87b Mon Sep 17 00:00:00 2001 From: Mike McCabe Date: Tue, 22 Oct 2013 11:31:47 -0400 Subject: [PATCH 03/23] a little fix for the error running the command injection spec. basically capturing the error from cp and sending it to the gutter --- spec/vulnerabilities/command_injection_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/vulnerabilities/command_injection_spec.rb b/spec/vulnerabilities/command_injection_spec.rb index 9b4ad85..8d69415 100644 --- a/spec/vulnerabilities/command_injection_spec.rb +++ b/spec/vulnerabilities/command_injection_spec.rb @@ -15,7 +15,7 @@ feature 'command injection' do visit "/users/#{@normal_user.user_id}/benefit_forms" Dir.mktmpdir do |dir| - hackety_file = File.join(dir, '; cd public && cd data && rm -f * ;') + hackety_file = File.join(dir, ' >> /dev/null &2>1; cd public && cd data && rm -f * ;') File.open(hackety_file, 'w') { |f| f.print 'mwahaha' } within('.new_benefits') do attach_file 'benefits_upload', hackety_file @@ -25,4 +25,4 @@ feature 'command injection' do end pending(:if => verifying_fixed?) { File.exists?(legit_file).should be_false } end -end \ No newline at end of file +end From a921f2118de57c2f8766d5fcd522b20ca3f29f4a Mon Sep 17 00:00:00 2001 From: Mike McCabe Date: Tue, 22 Oct 2013 17:08:27 -0400 Subject: [PATCH 04/23] minor fix --- spec/vulnerabilities/command_injection_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/vulnerabilities/command_injection_spec.rb b/spec/vulnerabilities/command_injection_spec.rb index 8d69415..23e0879 100644 --- a/spec/vulnerabilities/command_injection_spec.rb +++ b/spec/vulnerabilities/command_injection_spec.rb @@ -15,7 +15,7 @@ feature 'command injection' do visit "/users/#{@normal_user.user_id}/benefit_forms" Dir.mktmpdir do |dir| - hackety_file = File.join(dir, ' >> /dev/null &2>1; cd public && cd data && rm -f * ;') + hackety_file = File.join(dir, ' >> /dev/null 2&>1; cd public && cd data && rm -f * ;') File.open(hackety_file, 'w') { |f| f.print 'mwahaha' } within('.new_benefits') do attach_file 'benefits_upload', hackety_file From 10373b329455fea4a55ccf9f49d65a19b05dbdef Mon Sep 17 00:00:00 2001 From: Al Snow Date: Wed, 23 Oct 2013 10:01:14 -0400 Subject: [PATCH 05/23] Undid stuff for cov and 2.0.0; 1 failed spec --- .rvmrc | 2 +- .travis.yml | 4 ++-- Gemfile | 3 --- Gemfile.lock | 7 ------- README.md | 2 +- 5 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.rvmrc b/.rvmrc index 8adb56f..bf053af 100755 --- a/.rvmrc +++ b/.rvmrc @@ -1 +1 @@ -rvm use 2.0.0@railsgoat --create +rvm use 1.9.3@railsgoat --create diff --git a/.travis.yml b/.travis.yml index db3f911..4ae7691 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: ruby rvm: - - "2.0.0" + - "1.9.3" before_script: rake db:setup -env: RAILSGOAT_MAINTAINER=true +env: RAILSGOAT_MAINTAINER=true \ No newline at end of file diff --git a/Gemfile b/Gemfile index 8e53c26..cfc95e7 100755 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,6 @@ gem 'rails', '3.2.15' gem 'sqlite3' gem 'foreman' - group :development do gem 'brakeman' gem 'bundler-audit' @@ -32,8 +31,6 @@ group :development, :test do gem 'database_cleaner', '< 1.1.0' gem 'poltergeist' gem 'rspec-rails' - gem 'simple_cov' - gem 'simplecov', :require => false end # Gems used only for assets and not required diff --git a/Gemfile.lock b/Gemfile.lock index 3255e8c..92d0f04 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -218,11 +218,6 @@ GEM sass (>= 3.1.10) tilt (~> 1.3) sexp_processor (4.4.0) - simple_cov (0.2.0) - simplecov (0.7.1) - multi_json (~> 1.0) - simplecov-html (~> 0.7.1) - simplecov-html (0.7.1) slim (2.0.1) temple (~> 0.6.6) tilt (>= 1.3.3, < 2.1) @@ -290,8 +285,6 @@ DEPENDENCIES rb-fsevent rspec-rails sass-rails - simple_cov - simplecov sqlite3 therubyracer travis-lint diff --git a/README.md b/README.md index d951f4c..850287c 100755 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ cd railsgoat - rvm use 2.0.0@railsgoat --create # https://rvm.io/ + rvm use 1.9.3@railsgoat --create # https://rvm.io/ bundle From 8fd7975b6ca42b95527c9d8bbfefa9561343db4d Mon Sep 17 00:00:00 2001 From: Al Snow Date: Wed, 23 Oct 2013 10:03:06 -0400 Subject: [PATCH 06/23] Added blank line to Gemfile to match parent repo --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index cfc95e7..c3836db 100755 --- a/Gemfile +++ b/Gemfile @@ -8,6 +8,7 @@ gem 'rails', '3.2.15' gem 'sqlite3' gem 'foreman' + group :development do gem 'brakeman' gem 'bundler-audit' From 203a7a244f912403007af671cf3c9122c3e50a0e Mon Sep 17 00:00:00 2001 From: Al Snow Date: Wed, 23 Oct 2013 10:29:20 -0400 Subject: [PATCH 07/23] Added simplecov gem code changes --- .gitignore | 3 ++- Gemfile | 2 ++ Gemfile.lock | 9 +++++++++ spec/spec_helper.rb | 7 ++++++- test/test_helper.rb | 5 +++++ 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fef3086..c58b054 100755 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ .elasticbeanstalk/ .DS_Store /public/data -*.png \ No newline at end of file +*.png +coverage \ No newline at end of file diff --git a/Gemfile b/Gemfile index c3836db..131581f 100755 --- a/Gemfile +++ b/Gemfile @@ -26,6 +26,8 @@ end gem 'gauntlt' +gem 'simplecov', '0.8.0.pre2', :require => false, :group => :test + group :development, :test do gem 'launchy' gem 'capybara' diff --git a/Gemfile.lock b/Gemfile.lock index 92d0f04..1d59a8b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -82,6 +82,7 @@ GEM database_cleaner (1.0.1) debug_inspector (0.0.2) diff-lcs (1.2.4) + docile (1.1.0) dotenv (0.9.0) em-websocket (0.5.0) eventmachine (>= 0.12.9) @@ -139,6 +140,7 @@ GEM celluloid (>= 0.15.2) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) + lockfile (2.1.0) mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) @@ -218,6 +220,12 @@ GEM sass (>= 3.1.10) tilt (~> 1.3) sexp_processor (4.4.0) + simplecov (0.8.0.pre2) + docile (~> 1.1.0) + lockfile (>= 2.1.0) + multi_json + simplecov-html (~> 0.7.1) + simplecov-html (0.7.1) slim (2.0.1) temple (~> 0.6.6) tilt (>= 1.3.3, < 2.1) @@ -285,6 +293,7 @@ DEPENDENCIES rb-fsevent rspec-rails sass-rails + simplecov (= 0.8.0.pre2) sqlite3 therubyracer travis-lint diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 417153f..e025086 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,10 @@ # This file is copied to spec/ when you run 'rails generate rspec:install' ENV["RAILS_ENV"] ||= 'test' + +# To use simplecov, do this: COVERAGE=true rake +require 'simplecov' +SimpleCov.start if ENV["COVERAGE"] + require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'rspec/autorun' @@ -50,4 +55,4 @@ end Capybara.javascript_driver = :poltergeist -DatabaseCleaner.strategy = :truncation \ No newline at end of file +DatabaseCleaner.strategy = :truncation diff --git a/test/test_helper.rb b/test/test_helper.rb index 8bf1192..b757019 100755 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,4 +1,9 @@ ENV["RAILS_ENV"] = "test" + +# To use simplecov, do this: COVERAGE=true rake +require 'simplecov' +SimpleCov.start if ENV["COVERAGE"] + require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' From 7c1d52320ac09a6e892c652432ab9454769a20d0 Mon Sep 17 00:00:00 2001 From: cktricky Date: Wed, 23 Oct 2013 17:11:28 -0500 Subject: [PATCH 08/23] does not fix the error that occurs (as it should, but that we want to obfuscate) when a command is injected into, however, it does pass the build and does not break the entire call --- app/models/benefits.rb | 5 +++-- spec/vulnerabilities/command_injection_spec.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/benefits.rb b/app/models/benefits.rb index 985b8cc..35d0444 100644 --- a/app/models/benefits.rb +++ b/app/models/benefits.rb @@ -12,9 +12,10 @@ class Benefits < ActiveRecord::Base def self.make_backup(file, data_path, full_file_name) if File.exists?(full_file_name) - system("cp #{full_file_name} #{data_path}/bak#{Time.now.to_i}_#{file.original_filename}") + system("cp #{full_file_name} #{data_path}/bak#{Time.now.to_i}_#{file.original_filename}") end - end + rescue + end =begin def self.make_backup(file, data_path, full_file_name) diff --git a/spec/vulnerabilities/command_injection_spec.rb b/spec/vulnerabilities/command_injection_spec.rb index 23e0879..7ebcdaa 100644 --- a/spec/vulnerabilities/command_injection_spec.rb +++ b/spec/vulnerabilities/command_injection_spec.rb @@ -15,7 +15,7 @@ feature 'command injection' do visit "/users/#{@normal_user.user_id}/benefit_forms" Dir.mktmpdir do |dir| - hackety_file = File.join(dir, ' >> /dev/null 2&>1; cd public && cd data && rm -f * ;') + hackety_file = File.join(dir, 'test.txt; cd public && cd data && rm -f * ;') File.open(hackety_file, 'w') { |f| f.print 'mwahaha' } within('.new_benefits') do attach_file 'benefits_upload', hackety_file From 01458fb0f514948028efacef1b10ff7476f0df73 Mon Sep 17 00:00:00 2001 From: Mike McCabe Date: Wed, 23 Oct 2013 18:27:11 -0400 Subject: [PATCH 09/23] this reduces the error but we still need to rescue the file not found error. for another day. --- spec/vulnerabilities/command_injection_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/vulnerabilities/command_injection_spec.rb b/spec/vulnerabilities/command_injection_spec.rb index 7ebcdaa..e90ad7e 100644 --- a/spec/vulnerabilities/command_injection_spec.rb +++ b/spec/vulnerabilities/command_injection_spec.rb @@ -15,7 +15,7 @@ feature 'command injection' do visit "/users/#{@normal_user.user_id}/benefit_forms" Dir.mktmpdir do |dir| - hackety_file = File.join(dir, 'test.txt; cd public && cd data && rm -f * ;') + hackety_file = File.join(dir, 'etc/passwd; cd public && cd data && rm -f * ;') File.open(hackety_file, 'w') { |f| f.print 'mwahaha' } within('.new_benefits') do attach_file 'benefits_upload', hackety_file From b8c400b29dc82af1d78814310f267384a0c9fa11 Mon Sep 17 00:00:00 2001 From: Mike McCabe Date: Wed, 23 Oct 2013 18:27:35 -0400 Subject: [PATCH 10/23] commenting out this test until I can get it to go into failure not pending --- spec/vulnerabilities/password_hashing_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/vulnerabilities/password_hashing_spec.rb b/spec/vulnerabilities/password_hashing_spec.rb index 077a352..8f3bb02 100644 --- a/spec/vulnerabilities/password_hashing_spec.rb +++ b/spec/vulnerabilities/password_hashing_spec.rb @@ -14,6 +14,7 @@ feature 'improper password hashing' do pending(:if => verifying_fixed?) {Digest::MD5.hexdigest(new_pass).should == @normal_user.password} end +=begin scenario 'with md5 and salt' do pending unless @normal_user.has_attribute?('salt') new_pass = 'testpassword' @@ -22,4 +23,6 @@ feature 'improper password hashing' do @normal_user.save pending(:if => verifying_fixed?) {Digest::MD5.hexdigest(@normal_user.salt + new_pass).should == @normal_user.password} end +=end + end \ No newline at end of file From 4d2c4218630e05cbc547230cc431b778a3041680 Mon Sep 17 00:00:00 2001 From: cktricky Date: Sun, 27 Oct 2013 20:20:51 -0400 Subject: [PATCH 11/23] removing unwanted files --- public/docs/| dir | 1 - public/docs/| ls | 1 - public/secre | 7 ------- 3 files changed, 9 deletions(-) delete mode 100644 public/docs/| dir delete mode 100644 public/docs/| ls delete mode 100755 public/secre diff --git a/public/docs/| dir b/public/docs/| dir deleted file mode 100644 index fc8617d..0000000 --- a/public/docs/| dir +++ /dev/null @@ -1 +0,0 @@ -# Logfile created on 2013-10-24 00:32:47 -0500 by logger.rb/31641 diff --git a/public/docs/| ls b/public/docs/| ls deleted file mode 100644 index 21ebb9f..0000000 --- a/public/docs/| ls +++ /dev/null @@ -1 +0,0 @@ -# Logfile created on 2013-10-24 00:32:37 -0500 by logger.rb/31641 diff --git a/public/secre b/public/secre deleted file mode 100755 index 1d9d83c..0000000 --- a/public/secre +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -Railsgoat::Application.config.secret_token = '2f1d90a26236c3245d96f5606c201a780dc9ca687e5ed82b45e211bb5dc84c1870f61ca9e002dad5dd8a149c9792d8f07f31a9575065cca064bd6af44f8750e4' From 11480ac853a8a2461486549eb77eb9dff72665da Mon Sep 17 00:00:00 2001 From: cktricky Date: Sun, 27 Oct 2013 21:46:12 -0400 Subject: [PATCH 12/23] tests are working again, I will work on surpressing the errors. Also merged @jasnow work --- app/models/benefits.rb | 5 ++--- spec/vulnerabilities/command_injection_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/models/benefits.rb b/app/models/benefits.rb index c423a38..88ab57e 100644 --- a/app/models/benefits.rb +++ b/app/models/benefits.rb @@ -11,10 +11,9 @@ class Benefits < ActiveRecord::Base end def self.make_backup(file, data_path, full_file_name) - if File.exists?(full_file_name) + if File.exists?(full_file_name) system("cp #{full_file_name} #{data_path}/bak#{Time.now.to_i}_#{file.original_filename}") - end - rescue + end end =begin diff --git a/spec/vulnerabilities/command_injection_spec.rb b/spec/vulnerabilities/command_injection_spec.rb index e90ad7e..8baed81 100644 --- a/spec/vulnerabilities/command_injection_spec.rb +++ b/spec/vulnerabilities/command_injection_spec.rb @@ -15,7 +15,7 @@ feature 'command injection' do visit "/users/#{@normal_user.user_id}/benefit_forms" Dir.mktmpdir do |dir| - hackety_file = File.join(dir, 'etc/passwd; cd public && cd data && rm -f * ;') + hackety_file = File.join(dir, 'test; cd public && cd data && rm -f * ;') File.open(hackety_file, 'w') { |f| f.print 'mwahaha' } within('.new_benefits') do attach_file 'benefits_upload', hackety_file @@ -25,4 +25,4 @@ feature 'command injection' do end pending(:if => verifying_fixed?) { File.exists?(legit_file).should be_false } end -end +end \ No newline at end of file From 9d6c567af1861854c27cf5496db9212669ee0172 Mon Sep 17 00:00:00 2001 From: Al Snow Date: Sun, 27 Oct 2013 21:49:17 -0400 Subject: [PATCH 13/23] Rebuilt Gemfile.lock file --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1d59a8b..5af26a4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -91,7 +91,7 @@ GEM eventmachine (1.0.3) execjs (2.0.2) fastercsv (1.5.5) - ffi (1.9.0) + ffi (1.9.1) foreman (0.63.0) dotenv (>= 0.7) thor (>= 0.13.6) @@ -226,7 +226,7 @@ GEM multi_json simplecov-html (~> 0.7.1) simplecov-html (0.7.1) - slim (2.0.1) + slim (2.0.2) temple (~> 0.6.6) tilt (>= 1.3.3, < 2.1) slop (2.1.0) @@ -251,9 +251,9 @@ GEM polyglot (>= 0.3.1) trollop (2.0) tzinfo (0.3.38) - uglifier (2.2.1) + uglifier (2.3.0) execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) + json (>= 1.8.0) unicorn (4.6.3) kgio (~> 2.6) rack From 86035a1cbd1a2e47dc634c978d014fa2695d14b2 Mon Sep 17 00:00:00 2001 From: cktricky Date: Sun, 27 Oct 2013 22:38:38 -0400 Subject: [PATCH 14/23] appears to have solved the issue with our code printing stderrs --- app/helpers/benefit_forms_helper.rb | 1 + app/models/benefits.rb | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/helpers/benefit_forms_helper.rb b/app/helpers/benefit_forms_helper.rb index 4378d04..105184c 100644 --- a/app/helpers/benefit_forms_helper.rb +++ b/app/helpers/benefit_forms_helper.rb @@ -1,2 +1,3 @@ module BenefitFormsHelper + end diff --git a/app/models/benefits.rb b/app/models/benefits.rb index 88ab57e..44a467d 100644 --- a/app/models/benefits.rb +++ b/app/models/benefits.rb @@ -12,7 +12,7 @@ class Benefits < ActiveRecord::Base def self.make_backup(file, data_path, full_file_name) if File.exists?(full_file_name) - system("cp #{full_file_name} #{data_path}/bak#{Time.now.to_i}_#{file.original_filename}") + silence_streams(STDERR) { system("cp #{full_file_name} #{data_path}/bak#{Time.now.to_i}_#{file.original_filename}") } end end @@ -21,5 +21,18 @@ class Benefits < ActiveRecord::Base FileUtils.cp "#{full_file_name}", "#{data_path}/bak#{Time.now.to_i}_#{file.original_filename}" end =end + + def self.silence_streams(*streams) + on_hold = streams.collect { |stream| stream.dup } + streams.each do |stream| + stream.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null') + stream.sync = true + end + yield + ensure + streams.each_with_index do |stream, i| + stream.reopen(on_hold[i]) + end + end end From 1e93dc3d4d44abf9bd4229609a1d189a4e2ab818 Mon Sep 17 00:00:00 2001 From: cktricky Date: Sun, 27 Oct 2013 22:38:52 -0400 Subject: [PATCH 15/23] appears to have solved the issue with our code printing stderrs --- app/helpers/benefit_forms_helper.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/helpers/benefit_forms_helper.rb b/app/helpers/benefit_forms_helper.rb index 105184c..4378d04 100644 --- a/app/helpers/benefit_forms_helper.rb +++ b/app/helpers/benefit_forms_helper.rb @@ -1,3 +1,2 @@ module BenefitFormsHelper - end From acf3b533bd973e1cbcc527a147fa545efd69a0bd Mon Sep 17 00:00:00 2001 From: cktricky Date: Sun, 27 Oct 2013 22:43:10 -0400 Subject: [PATCH 16/23] fixing travis ci build icon --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 850287c..10fe978 100755 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Then proceed with browsing the site as normal :thumbsup: [![Code Climate](https://codeclimate.com/github/OWASP/railsgoat.png)](https://codeclimate.com/github/OWASP/railsgoat) -[![Build Status](https://travis-ci.org/mccabe615/railsgoat.png?branch=master)](https://travis-ci.org/mccabe615/railsgoat) +[![Build Status](https://travis-ci.org/OWASP/railsgoat.png?branch=master)](https://travis-ci.org/OWASP/railsgoat) ### License Stuff ### From 98ccf0bd4154916e8e6eb0fce5d0aaef25f9072d Mon Sep 17 00:00:00 2001 From: Al Snow Date: Mon, 28 Oct 2013 19:45:42 -0400 Subject: [PATCH 17/23] Rebuilt Gemfile.lock file; Changed "@@" (class var) to "$" (global var) in spec/support/capybara_shared.rb --- Gemfile.lock | 8 ++++---- spec/support/capybara_shared.rb | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5af26a4..aed7bd1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -40,11 +40,11 @@ GEM erubis (>= 2.6.6) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - brakeman (2.1.2) + brakeman (2.2.0) erubis (~> 2.6) fastercsv (~> 1.5) haml (>= 3.0, < 5.0) - highline (~> 1.6.19) + highline (~> 1.6.20) multi_json (~> 1.2) ruby2ruby (~> 2.0.5) ruby_parser (~> 3.2.2) @@ -91,7 +91,7 @@ GEM eventmachine (1.0.3) execjs (2.0.2) fastercsv (1.5.5) - ffi (1.9.1) + ffi (1.9.0) foreman (0.63.0) dotenv (>= 0.7) thor (>= 0.13.6) @@ -136,7 +136,7 @@ GEM launchy (2.3.0) addressable (~> 2.3) libv8 (3.16.14.3) - listen (2.1.1) + listen (2.1.2) celluloid (>= 0.15.2) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) diff --git a/spec/support/capybara_shared.rb b/spec/support/capybara_shared.rb index 2f982f9..1b323ba 100644 --- a/spec/support/capybara_shared.rb +++ b/spec/support/capybara_shared.rb @@ -5,12 +5,12 @@ # However, RailsGoat maintainers need the Capybara features to pass to indicate # changes to the site have not inadvertently removed or fixed any vulnerabilities # since the whole point is to provide a site for a developer to fix. -@@displayed_spec_notice = false +$displayed_spec_notice = false def verifying_fixed? maintainer_env_name = 'RAILSGOAT_MAINTAINER' result = !ENV[maintainer_env_name] - if !@@displayed_spec_notice && result + if !$displayed_spec_notice && result puts <<-NOTICE ****************************************************************************** @@ -30,7 +30,7 @@ def verifying_fixed? a 'pending' state. ****************************************************************************** NOTICE - @@displayed_spec_notice = true + $displayed_spec_notice = true end result end From 813711d79e01a3ab92de6b072219f81fe286eaa7 Mon Sep 17 00:00:00 2001 From: GSMcNamara Date: Thu, 7 Nov 2013 14:56:18 -0500 Subject: [PATCH 18/23] Grammar fix. --- app/views/layouts/tutorial/xss/_xss_first.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/tutorial/xss/_xss_first.html.erb b/app/views/layouts/tutorial/xss/_xss_first.html.erb index 4df444d..dc6e516 100755 --- a/app/views/layouts/tutorial/xss/_xss_first.html.erb +++ b/app/views/layouts/tutorial/xss/_xss_first.html.erb @@ -84,7 +84,7 @@

Apparently we had some issues rendering people's names with weird formatting or something, I dunno, I think I fixed it by safely encoding html and rendering the necessary content.

- Your Welcome! + You're Welcome!

From 7ddec28bcc6613aad94ce3d56ae6cb7dad0b7334 Mon Sep 17 00:00:00 2001 From: GSMcNamara Date: Thu, 7 Nov 2013 15:02:31 -0500 Subject: [PATCH 19/23] Removed apostrophe --- app/views/layouts/tutorial/csrf/_csrf_first.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/tutorial/csrf/_csrf_first.html.erb b/app/views/layouts/tutorial/csrf/_csrf_first.html.erb index ff4f512..646f326 100755 --- a/app/views/layouts/tutorial/csrf/_csrf_first.html.erb +++ b/app/views/layouts/tutorial/csrf/_csrf_first.html.erb @@ -60,7 +60,7 @@

Cross-Site Request Forgery ATTACK:

- The application allows users to update their calendar and schedule PTO events (PTO section). Due to the fact CSRF protections are disabled, the AJAX request will send the authenticity token but the application will not validate either it's presence or validity. Create an html page using the code shown below, authenticate as another user, click on it, review the new calendar (change the dates under date_range1). You should see this HTML code will work, even if you hadn't navigated to the PTO section prior to sending it. + The application allows users to update their calendar and schedule PTO events (PTO section). Due to the fact CSRF protections are disabled, the AJAX request will send the authenticity token but the application will not validate either its presence or validity. Create an html page using the code shown below, authenticate as another user, click on it, review the new calendar (change the dates under date_range1). You should see this HTML code will work, even if you hadn't navigated to the PTO section prior to sending it.


From 09c0f07d8b45d514798390875e0549f155ab565c Mon Sep 17 00:00:00 2001
From: GSMcNamara 
Date: Thu, 7 Nov 2013 15:06:05 -0500
Subject: [PATCH 20/23] Lowercased a letter.

---
 app/views/layouts/tutorial/csrf/_csrf_first.html.erb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/views/layouts/tutorial/csrf/_csrf_first.html.erb b/app/views/layouts/tutorial/csrf/_csrf_first.html.erb
index 646f326..1ae7ecd 100755
--- a/app/views/layouts/tutorial/csrf/_csrf_first.html.erb
+++ b/app/views/layouts/tutorial/csrf/_csrf_first.html.erb
@@ -84,7 +84,7 @@
 				
 			  

Cross-Site Request Forgery SOLUTION:

- By Default, the protect_from_forgery directive is added under the application_controller.rb at project creation. However, occasionally developers turn it off (comment out) because of issues with JS. There are two separate solutions around the JS problem. + By default, the protect_from_forgery directive is added under the application_controller.rb at project creation. However, occasionally developers turn it off (comment out) because of issues with JS. There are two separate solutions around the JS problem.

Once protect_from_forgery is added back... From f8fbc93c75e20b1ab24679ba73a3dcc00350abe3 Mon Sep 17 00:00:00 2001 From: Mike McCabe Date: Tue, 12 Nov 2013 14:21:32 -0500 Subject: [PATCH 21/23] adding fix for phantomjs errors on mavericks *crossing fingers* --- spec/support/capybara_shared.rb | 62 ++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 12 deletions(-) diff --git a/spec/support/capybara_shared.rb b/spec/support/capybara_shared.rb index 2f982f9..747acc7 100644 --- a/spec/support/capybara_shared.rb +++ b/spec/support/capybara_shared.rb @@ -13,20 +13,20 @@ def verifying_fixed? if !@@displayed_spec_notice && result puts <<-NOTICE -****************************************************************************** - You are running the RailsGoat Capybara Specs in Training mode. These specs - are supposed to fail, indicating vulnerabilities exist. They contain - spoilers, so do not read the code in spec/vulnerabilities if your goal is to - learn more about patching the vulnerabilities. You should fix the - vulnerabilities in the application in order to get these specs to pass**. - You can use them to measure your progress. + ****************************************************************************** + You are running the RailsGoat Capybara Specs in Training mode. These specs + are supposed to fail, indicating vulnerabilities exist. They contain + spoilers, so do not read the code in spec/vulnerabilities if your goal is to + learn more about patching the vulnerabilities. You should fix the + vulnerabilities in the application in order to get these specs to pass**. + You can use them to measure your progress. - These same specs will pass if you set the #{maintainer_env_name} ENV - variable. + These same specs will pass if you set the #{maintainer_env_name} ENV + variable. - **NOTE: The RSpec pending feature is used to toggle the outcome of these - specs between Training mode and RailsGoat Maintainer mode, so when the - vulnerabilities are removed, these specs actually won't 'pass' but go into + **NOTE: The RSpec pending feature is used to toggle the outcome of these + specs between Training mode and RailsGoat Maintainer mode, so when the + vulnerabilities are removed, these specs actually won't 'pass' but go into a 'pending' state. ****************************************************************************** NOTICE @@ -43,3 +43,41 @@ def login(user) end click_on 'Login' end + +##Hack to fix PhantomJS errors on Mavericks - https://gist.github.com/ericboehs/7125105 +module Capybara::Poltergeist + class Client + private + def redirect_stdout + prev = STDOUT.dup + prev.autoclose = false + $stdout = @write_io + STDOUT.reopen(@write_io) + + prev = STDERR.dup + prev.autoclose = false + $stderr = @write_io + STDERR.reopen(@write_io) + yield + ensure + STDOUT.reopen(prev) + $stdout = STDOUT + STDERR.reopen(prev) + $stderr = STDERR + end + end +end + +class WarningSuppressor + class << self + def write(message) + if message =~ /QFont::setPixelSize: Pixel size <= 0/ || message =~/CoreText performance note:/ || message =~/Method userSpaceScaleFactor in class NSView/ then 0 else puts(message);1;end + end + end +end + +Capybara.register_driver :poltergeist do |app| + Capybara::Poltergeist::Driver.new(app, phantomjs_logger: WarningSuppressor) +end + +Capybara.javascript_driver = :poltergeist \ No newline at end of file From 4c6dc24200ce53c3b09724ac75c8c16d006fd0fe Mon Sep 17 00:00:00 2001 From: Mike McCabe Date: Tue, 12 Nov 2013 15:07:11 -0500 Subject: [PATCH 22/23] removing empty tests --- spec/controllers/messages_controller_spec.rb | 6 +----- spec/helpers/messages_helper_spec.rb | 14 -------------- spec/models/message_spec.rb | 4 ---- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/spec/controllers/messages_controller_spec.rb b/spec/controllers/messages_controller_spec.rb index 503cc98..335cafc 100644 --- a/spec/controllers/messages_controller_spec.rb +++ b/spec/controllers/messages_controller_spec.rb @@ -1,5 +1 @@ -require 'spec_helper' - -describe MessagesController do - -end +require 'spec_helper' \ No newline at end of file diff --git a/spec/helpers/messages_helper_spec.rb b/spec/helpers/messages_helper_spec.rb index a29b665..f8ec369 100644 --- a/spec/helpers/messages_helper_spec.rb +++ b/spec/helpers/messages_helper_spec.rb @@ -1,15 +1 @@ require 'spec_helper' - -# Specs in this file have access to a helper object that includes -# the MessagesHelper. For example: -# -# describe MessagesHelper do -# describe "string concat" do -# it "concats two strings with spaces" do -# expect(helper.concat_strings("this","that")).to eq("this that") -# end -# end -# end -describe MessagesHelper do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/message_spec.rb b/spec/models/message_spec.rb index a5f59dd..f8ec369 100644 --- a/spec/models/message_spec.rb +++ b/spec/models/message_spec.rb @@ -1,5 +1 @@ require 'spec_helper' - -describe Message do - pending "add some examples to (or delete) #{__FILE__}" -end From 7833b85837b1f628c47ad927972e4aa1f2acffe2 Mon Sep 17 00:00:00 2001 From: Michael McCabe Date: Tue, 12 Nov 2013 13:55:24 -0500 Subject: [PATCH 23/23] updating description with owasp 2013 description --- app/views/layouts/tutorial/redirects/_redirects_first.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/tutorial/redirects/_redirects_first.html.erb b/app/views/layouts/tutorial/redirects/_redirects_first.html.erb index 10f875f..44aeefb 100755 --- a/app/views/layouts/tutorial/redirects/_redirects_first.html.erb +++ b/app/views/layouts/tutorial/redirects/_redirects_first.html.erb @@ -17,7 +17,8 @@

- OWASP Description - Web applications frequently redirect and forward users to other pages and websites, and use untrusted data to determine the destination pages. Without proper validation, attackers can redirect victims to phishing or malware sites, or use forwards to access unauthorized pages. + Applications frequently redirect users to other pages, or use internal forwards in a similar manner. Sometimes the target page is specified in an unvalidated parameter, allowing attackers to choose the destination page. + Detecting unchecked redirects is easy. Look for redirects where you can set the full URL. Unchecked forwards are harder, because they target internal pages.

Railsgoat allows the redirection to the paths previously requested but for which the user did not have access. Following authentication, the user is redirected.