summaryrefslogtreecommitdiff
path: root/users/test/integration/browser
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-08-08 14:26:10 +0200
committerAzul <azul@leap.se>2013-08-08 14:26:10 +0200
commit31441fc921c3a60bff7c606f1da343fdd62d80d5 (patch)
tree3526360311a2fc2c3194480b50a397c5fe8e2840 /users/test/integration/browser
parent1a3fdad01d9cb2e2596281d38ce0c0f1ad4da04a (diff)
parenta0b276e4b8ae86dec7deee898e85b65784d89933 (diff)
Merge branch 'bugfix/3410-close-srp-vulnerablility'
Diffstat (limited to 'users/test/integration/browser')
-rw-r--r--users/test/integration/browser/account_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/users/test/integration/browser/account_test.rb b/users/test/integration/browser/account_test.rb
index ce63baf..c65c491 100644
--- a/users/test/integration/browser/account_test.rb
+++ b/users/test/integration/browser/account_test.rb
@@ -20,4 +20,24 @@ class AccountTest < BrowserIntegrationTest
assert_equal '/', current_path
end
+ # trying to seed an invalid A for srp login
+ test "detects attempt to circumvent SRP" do
+ user = FactoryGirl.create :user
+ visit '/sessions/new'
+ fill_in 'Username', with: user.login
+ fill_in 'Password', with: "password"
+ inject_malicious_js
+ click_on 'Log In'
+ assert !page.has_content?("Welcome")
+ assert page.has_content?("Invalid random key")
+ end
+
+ def inject_malicious_js
+ page.execute_script <<-EOJS
+ var calc = new srp.Calculate();
+ calc.A = function(_a) {return "00";};
+ calc.S = calc.A;
+ srp.session = new srp.Session(null, calc);
+ EOJS
+ end
end