#34654: Post-normalization performed on the Username field leading to the 
bypass of
the whitespace stripping
------------------------------+------------------------------------
     Reporter:  Sim4n6        |                    Owner:  nobody
         Type:  Bug           |                   Status:  new
    Component:  contrib.auth  |                  Version:  dev
     Severity:  Normal        |               Resolution:
     Keywords:                |             Triage Stage:  Accepted
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+------------------------------------

Comment (by Sim4n6):

 The `contains_unwanted_characters()` would fail more often than you
 expect.

 {{{
 import unicodedata

 def contains_unwanted_characters(username):
     """Check if the username contains characters that normalize to
 whitespace."""
     normalized_username = unicodedata.normalize("NFKC", username)
     return username != normalized_username.strip()

 usernames = ["sim4n6", " ̈sim4n6 ̈", "℻", "Sim4n6","Sim4n6"]
 for username in usernames:
     print(contains_unwanted_characters(username))

 }}}

 Between I still believe there is a security concern here. Anyway, I have a
 security background and this issue is classified as non-related.  So, that
 would be my last comment regarding this issue.

 Regards,

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34654#comment:10>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070188f84e84f5-159bae65-5a55-43e6-8387-bb67963129b0-000000%40eu-central-1.amazonses.com.

Reply via email to