#31842: django.core.signing.dumps() and loads() not backwards compatible
---------------------------------------------+------------------------
               Reporter:  Markus Holtermann  |          Owner:  nobody
                   Type:  Bug                |         Status:  new
              Component:  Core (Other)       |        Version:  3.1
               Severity:  Release blocker    |       Keywords:
           Triage Stage:  Unreviewed         |      Has patch:  0
    Needs documentation:  0                  |    Needs tests:  0
Patch needs improvement:  0                  |  Easy pickings:  0
                  UI/UX:  0                  |
---------------------------------------------+------------------------
 In Django 3.1, the default algorithm for `django.core.signing.Signer` was
 changed from sha1 to sha256. That's good!

 However, the `django.core.signing.dumps()` and
 `django.core.signing.loads()` functions don't expose the algorithm. I
 think, that that makes an upgrade from 3.0 to 3.1 impossible when one uses
 the `dumps()` function in a multi-node Django setup.

 Let's say there are two servers. Both run an application with Django 3.0.
 and make use of `dumps()` and `loads()`. Then server 1 is upgraded to use
 Django 3.1. At this point, because of to the backwards compatibility parts
 in the decoding/signature validation, a token signed by server 2 can be
 loaded on server 1 and 2. However, a token signed by server 1 cannot be
 loaded on server 2.

 This problem could be mitigated by exposing the algorithm in the `dumps()`
 method and setting it to `sha1`. Once all servers run Django 3.1, the
 algorithm could be changed to `sha256`.

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

Reply via email to