rusty_paseto icon indicating copy to clipboard operation
rusty_paseto copied to clipboard

Wrong pasteo token cause runtime panic

Open techport-om opened this issue 7 months ago • 1 comments

Describe the bug While testing i discovered a case where the library will panic instead of throwing an error. Explicitly while attempting a wrong token "v4.local.1234".

The error is

rusty_paseto-0.6.0/src/core/paseto.rs:766:47:
range end index 32 out of range for slice of length 3

To Reproduce just try to decrypt "v4.local.1234"

Expected behavior i was expecting to catch the error same as other errors.

Additional context I think this problem could be solved by checking the length of the third part. I am interested to create a PR for this as first contribution.

techport-om avatar Dec 02 '23 06:12 techport-om