mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	CVE-2021-43791: Validate confirmation keys in /accounts/register/ codepath.
A confirmation link takes a user to the check_prereg_key_and_redirect endpoint, before getting redirected to POST to /accounts/register/. The problem was that validation was happening in the check_prereg_key_and_redirect part and not in /accounts/register/ - meaning that one could submit an expired confirmation key and be able to register. We fix this by moving validation into /accouts/register/.
This commit is contained in:
		
				
					committed by
					
						
						Alex Vandiver
					
				
			
			
				
	
			
			
			
						parent
						
							a1cd660147
						
					
				
				
					commit
					a014ef75a3
				
			@@ -170,9 +170,9 @@ class ConfirmationType:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
_properties = {
 | 
			
		||||
    Confirmation.USER_REGISTRATION: ConfirmationType("check_prereg_key_and_redirect"),
 | 
			
		||||
    Confirmation.USER_REGISTRATION: ConfirmationType("get_prereg_key_and_redirect"),
 | 
			
		||||
    Confirmation.INVITATION: ConfirmationType(
 | 
			
		||||
        "check_prereg_key_and_redirect", validity_in_days=settings.INVITATION_LINK_VALIDITY_DAYS
 | 
			
		||||
        "get_prereg_key_and_redirect", validity_in_days=settings.INVITATION_LINK_VALIDITY_DAYS
 | 
			
		||||
    ),
 | 
			
		||||
    Confirmation.EMAIL_CHANGE: ConfirmationType("confirm_email_change"),
 | 
			
		||||
    Confirmation.UNSUBSCRIBE: ConfirmationType(
 | 
			
		||||
@@ -182,7 +182,7 @@ _properties = {
 | 
			
		||||
    Confirmation.MULTIUSE_INVITE: ConfirmationType(
 | 
			
		||||
        "join", validity_in_days=settings.INVITATION_LINK_VALIDITY_DAYS
 | 
			
		||||
    ),
 | 
			
		||||
    Confirmation.REALM_CREATION: ConfirmationType("check_prereg_key_and_redirect"),
 | 
			
		||||
    Confirmation.REALM_CREATION: ConfirmationType("get_prereg_key_and_redirect"),
 | 
			
		||||
    Confirmation.REALM_REACTIVATION: ConfirmationType("realm_reactivation"),
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user