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
Applications encoding a JSON Web Token (JWT) may be vulnerable when it's not verified or algorithm is <code>none</code>.
9
+
</p>
10
+
</overview>
11
+
12
+
<recommendation>
13
+
<p>
14
+
JSON Web Tokens should be signed using a strong cryptographic algorithm and non-empty secret.
15
+
</p>
16
+
</recommendation>
17
+
18
+
<example>
19
+
<p>
20
+
In the example below, the secret used is an empty string and none algorithm is used. This may allow a malicious actor to make changes to a JWT payload.
21
+
</p>
22
+
23
+
<samplesrc="examples/EmptyJWTSecretBad.rb" />
24
+
25
+
<p>
26
+
The following code fixes the problem by using a non-empty cryptographic secret or key to encode JWT payloads.
27
+
</p>
28
+
29
+
<samplesrc="examples/EmptyJWTSecretGood.rb" />
30
+
</example>
31
+
32
+
<references>
33
+
<li>Auth0 Blog: <ahref="https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/#Meet-the--None--Algorithm">Meet the "None" Algorithm</a>.</li>
Applications decoding a JSON Web Token (JWT) may be vulnerable when the key isn't verified.
9
+
</p>
10
+
</overview>
11
+
12
+
<recommendation>
13
+
<p>
14
+
Calls to <code>verify()</code> functions should use a cryptographic secret or key to decode JWT payloads.</p>
15
+
</recommendation>
16
+
17
+
<example>
18
+
<p>
19
+
In the example below, false is used to disable the integrity enforcement of a JWT payload and none algorithm is used. This may allow a malicious actor to make changes to a JWT payload.
0 commit comments