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

Separator check fails #87

Closed
baratrion opened this issue Jul 19, 2017 · 2 comments
Closed

Separator check fails #87

baratrion opened this issue Jul 19, 2017 · 2 comments

Comments

@baratrion
Copy link

I'm able to inadvertently create a signature that contains separator itself.

See:

In [21]: s = Signer('secret-key', sep='_')

In [22]: signed = s.sign('foobar')

In [23]: signed
Out[23]: 'foobar_bM9Ftq9n87nl0Xc_Rs9orkssfJ0'

In [24]: s.unsign(signed)
---------------------------------------------------------------------------
BadSignature                              Traceback (most recent call last)
<ipython-input-24-ea5a1a92fab7> in <module>()
----> 1 s.unsign(signed)

/Users/catalbas/envs/token-test/lib/python2.7/site-packages/itsdangerous.pyc in unsign(self, signed_value)
    372             return value
    373         raise BadSignature('Signature %r does not match' % sig,
--> 374                            payload=value)
    375 
    376     def validate(self, signed_value):

BadSignature: Signature 'Rs9orkssfJ0' does not match
@RyanSquared
Copy link

please make sure that you are running a version that at least contains these lines: https://github.com/pallets/itsdangerous/blob/master/itsdangerous.py#L322-L326

@davidism
Copy link
Member

This will be resolved in the next release.

@pallets pallets locked as resolved and limited conversation to collaborators Feb 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants