File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,14 @@ We are passionate about developing and maintaining this open-source project to m
128128
129129# Changelog
130130
131+ # 2.10.6 (2025-10-02)
132+
133+ * Security: fix token impersonation vulnerability.
134+
135+ # 2.10.5 (2025-06-20)
136+
137+ * Send deprecation warning into the logs
138+
131139# 2.10.4 (2025-06-13)
132140
133141* ** New Features:**
Original file line number Diff line number Diff line change @@ -205,6 +205,17 @@ def test_auth_with_access_token(self):
205205 # Then authentication is successful
206206 self .assertStatus ('200 OK' )
207207
208+ def test_auth_with_access_token_different_user (self ):
209+ # Given a user with an access token
210+ userobj = UserObject .add_user ('testuser' , 'password' )
211+ userobj .commit ()
212+ token = userobj .add_access_token ('test2' ).encode ('ascii' )
213+ userobj .commit ()
214+ # When using this token to authenticated with /api
215+ self .getPage ('/api/' , headers = [("Authorization" , "Basic " + b64encode (b"admin:" + token ).decode ('ascii' ))])
216+ # Then authentication is successful
217+ self .assertStatus (401 )
218+
208219 def test_auth_failed_with_mfa_enabled (self ):
209220 # Given a user with MFA enabled
210221 userobj = UserObject .get_user (self .USERNAME )
Original file line number Diff line number Diff line change @@ -501,7 +501,7 @@ def validate_access_token(self, token):
501501 """
502502 Check if the given token matches.
503503 """
504- for access_token in Token .query .all ():
504+ for access_token in Token .query .filter ( Token . user == self ). all ():
505505 if access_token .is_expired :
506506 continue
507507 if check_password (token , access_token .hash_token ):
You can’t perform that action at this time.
0 commit comments