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

fix(utils/crypto): stringify the parameter which is object in createHash #452

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

yusukebe
Copy link
Member

@yusukebe yusukebe commented Aug 3, 2022

If an object type was passed as a parameter, the values would all be the same.

I've fixed it by making the object a different value by JSON.stringiy.

If the output values from the "object" and the "string" value are the same, the hash value will be the same. This is a specification.

Fix #451

@yusukebe yusukebe merged commit db17530 into main Aug 3, 2022
@yusukebe yusukebe deleted the fix/crypto-create-hash branch August 3, 2022 23:51
yusukebe added a commit that referenced this pull request Aug 4, 2022
…in `createHash` (#452)"

It was necessary to support not only json but also other.

This reverts commit db17530.
@yusukebe yusukebe added the fix label Aug 6, 2022
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

Successfully merging this pull request may close these issues.

Crypto createHash function is not type safe, breaking eTag middleware & timingSafeEqual
1 participant