Permalink
Show file tree
Hide file tree
3 comments
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
explicitly specifying number of elements when splitting JWE string
ref.) CVE-2019-18848
- Loading branch information
Showing
2 changed files
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ada16e7There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to work out why this has a CVE classed as high severity.
From what I can see, previously you could end (or start) the jwt with a
'.', thereby settingjwe.authentication_tagtonil, or end with'..'to set bothjwe.cipher_textandjwe.authentication_tagtoniletc. With this change, we now set the values to""instead ofnil.Processing the jwt would have always resulted in errors. The only issue I can see is that the errors would have been a mixture of
TypeErrorandNoMethodErrorand maybe others rather thanDecryptionFailed. Am I missing something?ada16e7There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a demonstration of the bug:
ada16e7There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand now.
authentication_tagwas set tonilbyinput.split, but what I missed was that the getter contains a default@authentication_tag ||= case.... This madeverify_cbc_authentication_tag!always succeed. Thank you for the reply.