Skip to content
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

Review salt usage #52

Closed
aaugustin opened this issue May 20, 2020 · 1 comment
Closed

Review salt usage #52

aaugustin opened this issue May 20, 2020 · 1 comment

Comments

@aaugustin
Copy link
Owner

Currently there are two uses of the SESAME_SALT setting, which likely have different characteristics.

From a quick analysis:

  • The salt in sign and unsign is for preventing an arbitrary string signed somewhere else in the same app (i.e. with the same SECRET_KEY) to be accepted by sesame as a valid token. It doesn't need to be secret. It just needs to be unique within the app.
  • The salt in create_token and parse_token is for making rainbow table attacks more difficult. (If such attacks are part of the threat model, probably you have bigger problems with django-sesame, but let's try to do things properly anyway.) Having the same salt for every token here makes no sens. Generating a random salt and storing it in the token would be better, but that would make tokens longer, while keeping them short is a design goal.

Ideas:

  • Remove the suggestion to customize SESAME_SALT from the README.
  • In the next tokens design, don't use a constant salt where that makes no sense.
aaugustin added a commit that referenced this issue May 23, 2020
Also this avoids showing a private API of Django.

Refs #52.

Reverts 8edb193 and 9f436a5.
@aaugustin
Copy link
Owner Author

Can't be fixed in tokens v1. Fixed in tokens v2 (#53).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant