Skip to content

Commit 7c8deb4

Browse files
committed
Call verifyPassword even if user does not exist.
Address timing attack caused by not doing the password check if the user doesn't exist. Can expose valid usernames. Really only useful for a tracker that doesn't allow anonymous access to issues. Issues usually show usernames as part of the message display.
1 parent 16d6f2b commit 7c8deb4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ Fixed:
7373
- issue2551108 - fix handling of designator links when formatted
7474
as markdown links. (Reported by Cedric Krier; John Rouillard)
7575
- Fix filename created from mail attachments, fixes issue2551118
76+
- Call verifyPassword even if user does not exist. Address timing
77+
attack to discover valid account names. Useful where anonymous user
78+
is not allowed access. (John Rouillard)
7679

7780
Features:
7881
- issue2550522 - Add 'filter' command to command-line

roundup/cgi/actions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,11 @@ def verifyLogin(self, username, password):
13571357
try:
13581358
self.client.userid = self.db.user.lookup(username)
13591359
except KeyError:
1360+
# Perform password check against anonymous user.
1361+
# Prevents guessing of valid usernames by detecting
1362+
# delay caused by checking password only on valid
1363+
# users.
1364+
_discard = self.verifyPassword("2", password)
13601365
raise exceptions.LoginError(self._('Invalid login'))
13611366

13621367
# verify the password

0 commit comments

Comments
 (0)