6 ms·
What if someone used the correct case but weird Unicode characters? I mean, if "none" = "nonE", is "none" = "none"
by gjvnq 7y ago
What if someone used the correct case but weird Unicode characters? I mean, if "none" = "nonE", is "none" = "none"
- CiPHPerCoder 7y agohttps://github.com/auth0/node-jsonwebtoken/blob/5f10bf9957a2541828501cfecab0310908b2f62f/verify.js#L120-L122 https://github.com/auth0/node-jsonwebtoken/blob/5f10bf9957a2... The end result depends entirely on the behavior of JavaScript's Array.indexOf() implementation.
- user5994461 7y agoGood catch. JWT is unicode out-of-the-box, which is really important to support non english user names and such. If Auth0 is doing any sort of normalization they will definitely be vulnerable to all the normalization bugs from unicode. Would be a great follow up vulnerability.
- theamk 7y agoThe answer to that is we should not be using _any_ case-insensitive strings in protocols. They are fine for human-visible names, but field names and internal enum values should use byte-by-byte comparison. It just makes entire class of vulnerabilities go away.
- deathanatos 7y agoThey are case-sensitive. > The "alg" value is a case-sensitive ASCII string containing a StringOrURI value. This Header Parameter MUST be present and MUST be understood and processed by implementations.
- JdeBP 7y agoBut the protocol says that they are case-insensitive! is not a good response to the assertion that machine-to-machine protocols should not be case-insensitive, which is what theamk said.