Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
240b1657
Commit
240b1657
authored
Nov 05, 2019
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update code copied from Devise
This was changed upstream to fix a vulnerability
parent
b7652b57
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
app/models/user.rb
app/models/user.rb
+2
-3
changelogs/unreleased/27433-fix-vulnerable-code-copied-from-devise.yml
...released/27433-fix-vulnerable-code-copied-from-devise.yml
+5
-0
No files found.
app/models/user.rb
View file @
240b1657
...
...
@@ -1420,14 +1420,13 @@ class User < ApplicationRecord
# flow means we don't call that automatically (and can't conveniently do so).
#
# See:
# <https://github.com/plataformatec/devise/blob/v4.
0.0/lib/devise/models/lockable.rb#L92
>
# <https://github.com/plataformatec/devise/blob/v4.
7.1/lib/devise/models/lockable.rb#L104
>
#
# rubocop: disable CodeReuse/ServiceClass
def
increment_failed_attempts!
return
if
::
Gitlab
::
Database
.
read_only?
self
.
failed_attempts
||=
0
self
.
failed_attempts
+=
1
increment_failed_attempts
if
attempts_exceeded?
lock_access!
unless
access_locked?
...
...
changelogs/unreleased/27433-fix-vulnerable-code-copied-from-devise.yml
0 → 100644
View file @
240b1657
---
title
:
Update incrementing of failed logins to be thread-safe
merge_request
:
19614
author
:
type
:
security
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment