-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
ada16e7
There 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_tag
tonil
, or end with'..'
to set bothjwe.cipher_text
andjwe.authentication_tag
tonil
etc. 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
TypeError
andNoMethodError
and maybe others rather thanDecryptionFailed
. Am I missing something?ada16e7
There 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:
ada16e7
There 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_tag
was set tonil
byinput.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.