-
-
Notifications
You must be signed in to change notification settings - Fork 74
parse_cookie_str
can be crashed by end users via cookie_str = 'true'
#135
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
Comments
The current implementation assumes every part of the cookie string will have a key-value pair separated by "=", but your test assumes that this is not always the case. Curious how and why you are parsing your cookie string differently. If you can shed some insight or your particular use case it would be helpful. Perhaps something like this could suffice:
Output:
|
I am also seeing this issue in Sentry |
Thanks for the report - I'll see if I have some time during the djangocon sprints today to work on some robustness. |
Hi!
I stumbled upon a crash report
ValueError: not enough values to unpack (expected 2, got 1)
in Sentry from django-cookie-consent code line…django-cookie-consent/cookie_consent/util.py
Line 15 in 81aae63
…today.
cookie_str
has value"true"
in this case, and playing with IPython shows how the current code breaks:The issue still exists on
master
so until this is fixed, Django setups can be crashed like this. Would be great to have fixed, thank you!Best, Sebastian
The text was updated successfully, but these errors were encountered: