If a JSON Web Token (JWT) is not signed with a strong cipher algorithm (or not signed at all) an attacker can forge it and impersonate user identities.
none algorithm to sign or verify the validity of a token. jwt-dotnet library:
var decodedtoken1 = decoder.Decode(token, secret, verify: false); // Noncompliant: signature should be verified var decodedtoken2 = new JwtBuilder() .WithSecret(secret) .Decode(forgedtoken1); // Noncompliant: signature should be verified
jwt-dotnet library:
var decodedtoken1 = decoder.Decode(forgedtoken1, secret, verify: true); // Compliant var decodedtoken2 = new JwtBuilder() .WithSecret(secret) .MustVerifySignature() .Decode(token); // Compliant