mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +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
				
			@@ -128,9 +128,9 @@ from zerver.views.registration import (
 | 
			
		||||
    accounts_home,
 | 
			
		||||
    accounts_home_from_multiuse_invite,
 | 
			
		||||
    accounts_register,
 | 
			
		||||
    check_prereg_key_and_redirect,
 | 
			
		||||
    create_realm,
 | 
			
		||||
    find_account,
 | 
			
		||||
    get_prereg_key_and_redirect,
 | 
			
		||||
    realm_redirect,
 | 
			
		||||
)
 | 
			
		||||
from zerver.views.report import (
 | 
			
		||||
@@ -559,8 +559,8 @@ i18n_urls = [
 | 
			
		||||
    path("accounts/register/", accounts_register, name="accounts_register"),
 | 
			
		||||
    path(
 | 
			
		||||
        "accounts/do_confirm/<confirmation_key>",
 | 
			
		||||
        check_prereg_key_and_redirect,
 | 
			
		||||
        name="check_prereg_key_and_redirect",
 | 
			
		||||
        get_prereg_key_and_redirect,
 | 
			
		||||
        name="get_prereg_key_and_redirect",
 | 
			
		||||
    ),
 | 
			
		||||
    path(
 | 
			
		||||
        "accounts/confirm_new_email/<confirmation_key>",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user