Merge pull request #8928 from Mic92/master

use constant-time string compare for internal api authentication
This commit is contained in:
Robert Schilling
2015-03-07 08:22:58 +01:00
+4 -1
View File
@@ -83,7 +83,10 @@ module API
end
def authenticate_by_gitlab_shell_token!
unauthorized! unless secret_token == params['secret_token'].try(:chomp)
input = params['secret_token'].try(:chomp)
unless Devise.secure_compare(secret_token, input)
unauthorized!
end
end
def authenticated_as_admin!