#31807: Whether support more secure method to generate session id
--------------------------------------------+------------------------
               Reporter:  dotuser           |          Owner:  nobody
                   Type:  New feature       |         Status:  new
              Component:  contrib.sessions  |        Version:  2.2
               Severity:  Normal            |       Keywords:
           Triage Stage:  Unreviewed        |      Has patch:  0
    Needs documentation:  0                 |    Needs tests:  0
Patch needs improvement:  0                 |  Easy pickings:  0
                  UI/UX:  0                 |
--------------------------------------------+------------------------
 Since django generate session id will utilize `random.SystemRandom()`
 firstly and then fallback to `random`[1]. According to doc, random have
 security issue for security or cryptographic uses[2]. Although doc says
 `secrets` module,  but `secrets` module will also utilize `SystemRandom`
 to generate[3]

 Read `/dev/random/` will produce block and then it have a little effect on
 performance for application in Linux

 So, have any plan to change a secure method to generate session id? Thanks
 !

 [1]
 [https://github.com/django/django/blob/2.2.13/django/utils/crypto.py#L48-L69]
 [2] [https://docs.python.org/3.7/library/random.html]
 [3] [https://docs.python.org/3/library/secrets.html#secrets.SystemRandom]

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31807>
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/050.299b2c932c11498c6d265a1bde3e253e%40djangoproject.com.

Reply via email to