Modify ↓
Opened 3 years ago
Closed 3 years ago
#13467 closed defect (fixed)
Basic authentication failing when colon characters are used in password
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.4.4 |
Component: | web frontend/tracd | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Fix basic authention when colon characters are used in password. |
||
API Changes: | |||
Internal Changes: |
Description
I noticed that BasicAuthentication.do_auth
has an issue in splitting by colon character while working of #13464. In fact, the basic authentication is failing when colon characters are used in the password.
-
trac/web/auth.py
diff --git a/trac/web/auth.py b/trac/web/auth.py index 77744babc..8363bcb0c 100644
a b class BasicAuthentication(PasswordFileAuthentication): 365 365 def do_auth(self, environ, start_response): 366 366 header = environ.get('HTTP_AUTHORIZATION') 367 367 if header and header.startswith('Basic'): 368 auth = b64decode(header[6:]).split(':' )368 auth = b64decode(header[6:]).split(':', 1) 369 369 if len(auth) == 2: 370 370 user, password = auth 371 371 if self.test(user, password):
Attachments (0)
Change History (3)
comment:1 by , 3 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:3 by , 3 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Thanks for the reviewing. Committed and merged in [17576-17579].
Note:
See TracTickets
for help on using tickets.
Proposed changes in: