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

'Expected hexadecimal character' exception from $cookie->fetch() after upgrade #183

Open
pandabadger opened this issue Dec 17, 2022 · 0 comments

Comments

@pandabadger
Copy link

pandabadger commented Dec 17, 2022

When reading cookies that were encrypted using v4.8 in v5.1 I'm seeing exceptions with the message 'Expected hexadecimal character'.

RangeException: Expected hexadecimal character in vendor/paragonie/constant_time_encoding/src/Hex.php:132
Stack trace: #0 vendor/paragonie/halite/src/Cookie.php(139): ParagonIE\ConstantTime\Hex::decode() # 1 vendor/paragonie/halite/src/Cookie.php(100): ParagonIE\Halite\Cookie::getConfig()

I see non-hex version prefixes being passed if fails the hash_equals() check in getConfig(). Seemed OK after just removing the call to Hex::decode() at line 139 in Cookie.php, but haven't checked what other impact that could have.

Not a huge deal since can just invalidate the cookies and create new. But maybe something that could be patched for future versions?

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