-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There's an infinitesimally small possibility an existing token gets overwritten. #9250
Comments
Yep that looks like a very sensible measure. |
Reassuringly "large" is an understatment here. But yes, the We should really be pointing towards our security policy and following issues like this up promptly, but the project maintainership has been severely over-extended recently. We're now getting back onto a more even keel. |
I'm not really into this project, but I saw this issue... To the author of this issue: you shouldn't report security issues publicly. To the maintainers: this should have been closed as soon as this was read, and recreated on another communication channel (email, private forum, etc) for triage. |
This isn't an exploitable security issue in reality, tho we ought to have been be keeping good policy regardless yes. |
Should this fix be considered a potential breaking change? e.g if some folks relied on the current behaviour to rotate an existing token. They would clear the |
Would that even work? I'll test that when I prepare the PR. |
django-rest-framework/rest_framework/authtoken/models.py
Lines 9 to 37 in 5ad467a
The sample space is large
2 ** (8 * 20)
, but the probability is not 0 thatgenerate_key
returns a key that already exists, and then the save would update the existing one.The smallest change, turns this into an integrity error:
The text was updated successfully, but these errors were encountered: