You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: java/ql/src/experimental/Security/CWE/CWE-347/MissingJWTSignatureCheck.qhelp
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
<qhelp>
3
3
4
4
<overview>
5
-
<p> A JWT consists of three parts: header, payload, and signature.
5
+
<p> A JSON Web Token (JWT) consists of three parts: header, payload, and signature.
6
6
The <code>io.jsonwebtoken.jjwt</code> library is one of many libraries used for working with JWTs.
7
7
It offers different methods for parsing tokens like <code>parse</code>, <code>parseClaimsJws</code>, and <code>parsePlaintextJws</code>.
8
8
The last two correctly verify that the JWT is properly signed.
@@ -12,7 +12,7 @@ comparing the locally computed signature with the signature part of the JWT.
12
12
<p>
13
13
Therefore it is necessary to provide the <code>JwtParser</code> with a key that is used for signature validation.
14
14
Unfortunately the <code>parse</code> method <b>accepts</b> a JWT whose signature is empty although a signing key has been set for the parser.
15
-
This means that an attacker can create arbitrary JWTs that will be accepted.
15
+
This means that an attacker can create arbitrary JWTs that will be accepted if this method is used.
16
16
</p>
17
17
</overview>
18
18
<recommendation>
@@ -36,4 +36,4 @@ The third and fourth good cases use <code>parseClaimsJws</code> method or overri
36
36
<references>
37
37
<li>zofrex: <ahref="https://www.zofrex.com/blog/2020/10/20/alg-none-jwt-nhs-contact-tracing-app/">How I Found An alg=none JWT Vulnerability in the NHS Contact Tracing App</a>.</li>
0 commit comments