TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Critical Vulnerabilities in JSON Web Token Libraries

147 点作者 pr0zac大约 10 年前

13 条评论

bbrazil大约 10 年前
Be wary if you do anything with signed data before you verify the signature.<p><a href="http:&#x2F;&#x2F;www.thoughtcrime.org&#x2F;blog&#x2F;the-cryptographic-doom-principle&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.thoughtcrime.org&#x2F;blog&#x2F;the-cryptographic-doom-prin...</a>
评论 #9302394 未加载
评论 #9301904 未加载
odino大约 10 年前
By the way, claps for Tim for the amazing job. He contacted various people and gave them heads up weeks ago. I think the wat this was handled was awesome.<p>&lt;3 OSS
Kiro大约 10 年前
I don&#x27;t understand why you need the alg property at all. I mean, you are the one issuing the token so you definitely know what algorithm is used in the back-end. Why is this necessary?
评论 #9302510 未加载
评论 #9303268 未加载
s_kilk大约 10 年前
I found a (thematically) similar issue in the clojure jwt library last year [1]. Now I&#x27;m wondering if the issue may be wider than just that library.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;liquidz&#x2F;clj-jwt&#x2F;issues&#x2F;8" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;liquidz&#x2F;clj-jwt&#x2F;issues&#x2F;8</a>
zaroth大约 10 年前
Also see: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9111049" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9111049</a><p>Where are the CVEs?! ... OK, I just sent a brief write-up to the oss-security list, we&#x27;ll see what happens.
评论 #9303869 未加载
the_mitsuhiko大约 10 年前
I&#x27;m glad someone of not finally made a statement about that. I have reported two bugs like this against libraries in the last two years and the general feedback has been, that it&#x27;s not an issue. They just removed the none algorithm entirely.
d4mi3n大约 10 年前
For those of you concerned about if a JWT library you&#x27;re using is vulnerable, you can see the current list of verified&#x2F;validate clients for each language here: <a href="http:&#x2F;&#x2F;jwt.io&#x2F;" rel="nofollow">http:&#x2F;&#x2F;jwt.io&#x2F;</a> (page down to see the list)<p>My team has been using ruby-jwt, so I&#x27;m glad to see that at least does not seem to be on the list of vulnerable libraries.
omgitstom大约 10 年前
I&#x27;ve actually seen this same issue in JWT libs before (August 2014) as well. I think one of the main issue is JWT is simple to implement, the specification seems to be unclear about how to treat unsecure JWTs (with the `none` alg).<p>From the specificaiton: Even if a JWT can be successfully validated, unless the algorithm(s) used in the JWT are acceptable to the application, it SHOULD reject the JWT.<p>So what it is saying is that you should have code in your application to make sure to only trust algorithms that you like.<p>The other issue is that following the specifications rules for validation get you in a hairy spot where this vulnerability exist:<p><a href="https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;draft-ietf-oauth-json-web-token-32#section-7.2" rel="nofollow">https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;draft-ietf-oauth-json-web-token-...</a>
评论 #9305557 未加载
laumars大约 10 年前
Can someone please explain to me the appeal of tokens like the following please?<p><pre><code> payload = &#x27;{&quot;loggedInAs&quot;:&quot;admin&quot;,&quot;iat&quot;:1422779638}&#x27; </code></pre> I&#x27;ve always worked under the assumption that everything the client sends is wrong; which means the only fields I issue are a user hash and session key. If either of those don&#x27;t match the session table record then the token is rejected. Having group permissions issued from the client side seems like a bad design from the offset - however this seems a really obvious point to make, which makes me wonder if I&#x27;m missing the point of JWT&#x27;s.<p>Is anyone able to expand on this for me please?
评论 #9302818 未加载
评论 #9302937 未加载
评论 #9302304 未加载
评论 #9302207 未加载
MrBuddyCasino大约 10 年前
If you love to confirm your stereotypes as much as the next guy, take a closer look at the languages:<p>- Ruby, Java, Lua, Scala and .NET are unaffected<p>- updates are available for Node.js and Python<p>- there are still no fixed version for JavaScript and PHP libs
评论 #9307148 未加载
mfjordvald大约 10 年前
They list the php-jwt library from firebase as vulnerable but I can&#x27;t see why. As far as I can see they do not support the None algorithm.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;firebase&#x2F;php-jwt&#x2F;blob&#x2F;master&#x2F;Authentication&#x2F;JWT.php" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;firebase&#x2F;php-jwt&#x2F;blob&#x2F;master&#x2F;Authenticati...</a><p>It&#x27;s not in the methods array and the decode method specifically does a check to see if it&#x27;s empty.<p>if (empty($header-&gt;alg)) { throw exception }<p>Can anyone throw some light on this?
评论 #9301931 未加载
tptacek大约 10 年前
Don&#x27;t use JSON Web Tokens.
评论 #9305120 未加载
评论 #9304493 未加载
pvg大约 10 年前
Original, non-spam source is:<p><a href="https:&#x2F;&#x2F;www.timmclean.net&#x2F;2015&#x2F;03&#x2F;31&#x2F;jwt-algorithm-confusion.html" rel="nofollow">https:&#x2F;&#x2F;www.timmclean.net&#x2F;2015&#x2F;03&#x2F;31&#x2F;jwt-algorithm-confusion...</a>
评论 #9302910 未加载