Skip to content

Commit 6d69c49

Browse files
committed
Remove dead code for handling LogoutAction.
Dead code starts wih: ''' # I think now that LogoutAction redirects to # self.base ([tracker] web parameter in config.ini), # this code is not needed. However I am keeping it # around in case it has to come back to life. # Delete if this is still around in 3/2018. # rouilj 3/2017. # # Note using this code may cause a CSRF Login vulnerability. # Handle the case where user logs out and tries to # log in again in same window. # The csrf token for the login button is associated # with the prior login, so it will not validate.
1 parent 18f127d commit 6d69c49

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

roundup/cgi/client.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,41 +1566,6 @@ def handle_csrf(self, api=False):
15661566

15671567
current_session = self.session_api._sid
15681568

1569-
'''
1570-
# I think now that LogoutAction redirects to
1571-
# self.base ([tracker] web parameter in config.ini),
1572-
# this code is not needed. However I am keeping it
1573-
# around in case it has to come back to life.
1574-
# Delete if this is still around in 3/2018.
1575-
# rouilj 3/2017.
1576-
#
1577-
# Note using this code may cause a CSRF Login vulnerability.
1578-
# Handle the case where user logs out and tries to
1579-
# log in again in same window.
1580-
# The csrf token for the login button is associated
1581-
# with the prior login, so it will not validate.
1582-
#
1583-
# To bypass error, Verify that nonce_user != user and that
1584-
# user is '2' (anonymous) and there is no current
1585-
# session key. Validate that the csrf exists
1586-
# in the db and nonce_user and nonce_session are not None.
1587-
# Also validate that the action is Login.
1588-
# Lastly requre at least one csrf header check to pass.
1589-
# If all of those work process the login.
1590-
if current_user != nonce_user and \
1591-
current_user == '2' and \
1592-
current_session is None and \
1593-
nonce_user is not None and \
1594-
nonce_session is not None and \
1595-
"@action" in self.form and \
1596-
self.form["@action"].value == "Login":
1597-
if header_pass > 0:
1598-
otks.destroy(key)
1599-
otks.commit()
1600-
return True
1601-
else:
1602-
self.add_error_message("Reload window before logging in.")
1603-
'''
16041569
# validate against user and session
16051570
if current_user != nonce_user:
16061571
logmsg = self._(

0 commit comments

Comments
 (0)