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

Enhancement: HMAC Verification doesn't utilise timestamp to prevent spoofing #5479

Open
below43 opened this issue Sep 22, 2022 · 1 comment
Labels
need-discussion These issues don't have a clear direction, and it requires deeper discussion to finalize product Issues related to the product

Comments

@below43
Copy link

below43 commented Sep 22, 2022

Is your enhancement request related to a problem? Please describe.
Presently the verification token is generated using an HMAC of the user's identifier and the User Identity Validation key. The problem with this is it's the same every time, meaning it can be copied and used to "spoof" the user elsewhere, and can end up making it easier to calculate what the validation key is.

Describe the solution you'd like
Ideally the verification token would be time limited, and hashed differently every time to prevent this occurring. The easiest way to achieve this is for the website to include the timestamp in the parameters, along with hashing the timestamp in the HMAC (id + validation key + timestamp)

The server can then verify the timestamp is a valid time range, and can also validate the token sent through (by including the timestamp in the HMAC to compare).

Describe alternatives you've considered
Using a NONCE retrieved from the server is an alternative, but cumbersome compared to the timestamp approach.

Additional context
Identity validation in Chatwoot

AWS approach to HMAC utilising timestamps to salt and verify the HMAC

@pranavrajs
Copy link
Member

@below43 Thanks for the suggestion. @sojan-offical Tagging you for visibility.

@pranavrajs pranavrajs added need-discussion These issues don't have a clear direction, and it requires deeper discussion to finalize product Issues related to the product labels Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-discussion These issues don't have a clear direction, and it requires deeper discussion to finalize product Issues related to the product
Projects
None yet
Development

No branches or pull requests

2 participants