CVE-2021-32631 (published 2021-07-26T16:15Z)

Common is a package of common modules that can be accessed by NIMBLE services. Common before commit number 3b96cb0293d3443b870351945f41d7d55cb34b53 did not properly verify the signature of JSON Web Tokens. This allows someone to forge a valid JWT. Being able to forge JWTs may lead to authentication bypasses. Commit number 3b96cb0293d3443b870351945f41d7d55cb34b53 contains a patch for the issue. As a workaround, one may use the parseClaimsJws method to correctly verify the signature of a JWT.

Severity: MEDIUM
CVSS v2 base score: 4.0 (AV:N/AC:L/Au:S/C:N/I:P/A:N)
CVSS v3 base score: 6.5, MEDIUM (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N)

Weakness information:
cwe_id: CWE-290
cwe_name: Authentication Bypass by Spoofing
description: This attack-focused weakness is caused by incorrectly implemented authentication schemes that are subject to spoofing attacks.
extended_description: 
            
            
         
         

Fix information:
repo_url: https://github.com/nimble-platform/common
commit_details: repo_url: https://github.com/nimble-platform/common
author: dogukan10
author_date: 2021-07-26 14:22:37+03:00
msg: Use parseClaimsJws method instead of parseJws
repository: repo_url: https://github.com/nimble-platform/common
repo_name: nimble-platform/common
description: Common modules that can be accessed by the other NIMBLE services.
repo_language: Java
owner: nimble-platform
file_changes: filename: ValidationUtil.java
change_type: ModificationType.MODIFY
diff: @@ -36,7 +36,7 @@ public class ValidationUtil implements IValidationUtil {
             RsaKeyUtil rsaKeyUtil = new RsaKeyUtil();
             PublicKey publicKey = rsaKeyUtil.fromPemEncoded(keycloakPublicKey);
 
-            return Jwts.parser().setSigningKey(publicKey).parseJws(token.replace("Bearer ", "")).getBody();
+            return Jwts.parser().setSigningKey(publicKey).parseClaimsJws(token.replace("Bearer ", "")).getBody();
         } catch (Exception e){
             throw new AuthenticationException(String.format("Failed to check user authorization for token: %s", token), e);
         }

programming_language: Java
repo_url: https://github.com/nimble-platform/common
commit_details: repo_url: https://github.com/nimble-platform/common
author: Oliver Jung
author_date: 2021-05-20 10:02:42+02:00
msg: Fixed JWT validation according to https://github.com/nimble-platform/common/security/advisories/GHSA-fjq8-896w-pv28
repository: repo_url: https://github.com/nimble-platform/common
repo_name: nimble-platform/common
description: Common modules that can be accessed by the other NIMBLE services.
repo_language: Java
owner: nimble-platform
file_changes: filename: ValidationUtil.java
change_type: ModificationType.MODIFY
diff: @@ -36,7 +36,7 @@ public class ValidationUtil implements IValidationUtil {
             RsaKeyUtil rsaKeyUtil = new RsaKeyUtil();
             PublicKey publicKey = rsaKeyUtil.fromPemEncoded(keycloakPublicKey);
 
-            return (Claims) Jwts.parser().setSigningKey(publicKey).parse(token.replace("Bearer ", "")).getBody();
+            return Jwts.parser().setSigningKey(publicKey).parseJws(token.replace("Bearer ", "")).getBody();
         } catch (Exception e){
             throw new AuthenticationException(String.format("Failed to check user authorization for token: %s", token), e);
         }

programming_language: Java
repo_url: https://github.com/nimble-platform/common
commit_details: repo_url: https://github.com/nimble-platform/common
author: Doğukan Çavdaroğlu
author_date: 2021-07-26 15:15:36+03:00
msg: Merge pull request #81 from nimble-platform/staging

Staging
repository: repo_url: https://github.com/nimble-platform/common
repo_name: nimble-platform/common
description: Common modules that can be accessed by the other NIMBLE services.
repo_language: Java
owner: nimble-platform