diff --git a/java/ql/src/experimental/Security/CWE/CWE-321/HardcodedJwtKey.java b/java/ql/src/experimental/Security/CWE/CWE-321/HardcodedJwtKey.java
new file mode 100644
index 000000000000..697127946895
--- /dev/null
+++ b/java/ql/src/experimental/Security/CWE/CWE-321/HardcodedJwtKey.java
@@ -0,0 +1,26 @@
+// BAD: Get secret from hardcoded string then sign a JWT token
+Algorithm algorithm = Algorithm.HMAC256("hardcoded_secret");
+JWT.create()
+ .withClaim("username", username)
+ .sign(algorithm);
+}
+
+// BAD: Get secret from hardcoded string then verify a JWT token
+JWTVerifier verifier = JWT.require(Algorithm.HMAC256("hardcoded_secret"))
+ .withIssuer(ISSUER)
+ .build();
+verifier.verify(token);
+
+// GOOD: Get secret from system configuration then sign a token
+String tokenSecret = System.getenv("SECRET_KEY");
+Algorithm algorithm = Algorithm.HMAC256(tokenSecret);
+JWT.create()
+ .withClaim("username", username)
+ .sign(algorithm);
+ }
+
+// GOOD: Get secret from environment variable then verify a JWT token
+JWTVerifier verifier = JWT.require(Algorithm.HMAC256(System.getenv("SECRET_KEY")))
+ .withIssuer(ISSUER)
+ .build();
+verifier.verify(token);
diff --git a/java/ql/src/experimental/Security/CWE/CWE-321/HardcodedJwtKey.qhelp b/java/ql/src/experimental/Security/CWE/CWE-321/HardcodedJwtKey.qhelp
new file mode 100644
index 000000000000..e6a25a3b96c7
--- /dev/null
+++ b/java/ql/src/experimental/Security/CWE/CWE-321/HardcodedJwtKey.qhelp
@@ -0,0 +1,46 @@
+
+
+ JWT (JSON Web Token) is an open standard (RFC 7519) that defines a way to provide information
+ within a JSON object between two parties. JWT is widely used for sharing security information
+ between two parties in web applications. Each JWT contains encoded JSON objects, including a
+ set of claims. JWTs are signed using a cryptographic algorithm to ensure that the claims cannot
+ be altered after the token is issued.
+
+ The most basic mistake is using hardcoded secrets for JWT generation/verification. This allows
+ an attacker to forge the token if the source code (and JWT secret in it) is publicly exposed or
+ leaked, which leads to authentication bypass or privilege escalation.
+
+ Generating a cryptographically secure secret key during application initialization and using this
+ generated key for JWT signing/verification requests can prevent this vulnerability. Or safely store
+ the secret key in a key vault that cannot be leaked in source code.
+
+ The following examples show the bad case and the good case respectively. The bad
+ methods show a hardcoded secret key is used to sign and verify JWT tokens. In the good
+ method, the secret key is loaded from a system environment during application initialization.
+
+ * Note that this method doesn't verify the token's signature! Use it only if you trust the token or you already verified it. + * + * @param token with jwt format as string. + * @return a decoded JWT. + * @throws JWTDecodeException if any part of the token contained an invalid jwt or JSON format of each of the jwt parts. + */ + public DecodedJWT decodeJwt(String token) throws JWTDecodeException { + return null; + } + + /** + * Decode a given Json Web Token. + *
+ * Note that this method doesn't verify the token's signature! Use it only if you trust the token or you already verified it. + * + * @param token with jwt format as string. + * @return a decoded JWT. + * @throws JWTDecodeException if any part of the token contained an invalid jwt or JSON format of each of the jwt parts. + */ + public static DecodedJWT decode(String token) throws JWTDecodeException { + return null; + } + + /** + * Returns a {@link JWTVerifier} builder with the algorithm to be used to validate token signature. + * + * @param algorithm that will be used to verify the token's signature. + * @return {@link JWTVerifier} builder + * @throws IllegalArgumentException if the provided algorithm is null. + */ + public static Verification require(Algorithm algorithm) { + return null; + } + + /** + * Returns a Json Web Token builder used to create and sign tokens + * + * @return a token builder. + */ + public static JWTCreator.Builder create() { + return null; + } +} \ No newline at end of file diff --git a/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/JWTCreator.java b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/JWTCreator.java new file mode 100644 index 000000000000..863298425bd6 --- /dev/null +++ b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/JWTCreator.java @@ -0,0 +1,300 @@ +package com.auth0.jwt; + +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.exceptions.JWTCreationException; + +import java.util.*; + +/** + * The JWTCreator class holds the sign method to generate a complete JWT (with Signature) from a given Header and Payload content. + *
+ * This class is thread-safe.
+ */
+public final class JWTCreator {
+ /**
+ * Initialize a JWTCreator instance.
+ *
+ * @return a JWTCreator.Builder instance to configure.
+ */
+ static JWTCreator.Builder init() {
+ return null;
+ }
+
+ /**
+ * The Builder class holds the Claims that defines the JWT to be created.
+ */
+ public static class Builder {
+ Builder() {
+ }
+
+ /**
+ * Add specific Claims to set as the Header.
+ * If provided map is null then nothing is changed
+ * If provided map contains a claim with null value then that claim will be removed from the header
+ *
+ * @param headerClaims the values to use as Claims in the token's Header.
+ * @return this same Builder instance.
+ */
+ public Builder withHeader(Map
+ * Accepted nested types are {@linkplain Map} and {@linkplain List} with basic types
+ * {@linkplain Boolean}, {@linkplain Integer}, {@linkplain Long}, {@linkplain Double},
+ * {@linkplain String} and {@linkplain Date}. {@linkplain Map}s cannot contain null keys or values.
+ * {@linkplain List}s can contain null elements.
+ *
+ * @param name the Claim's name.
+ * @param map the Claim's key-values.
+ * @return this same Builder instance.
+ * @throws IllegalArgumentException if the name is null, or if the map contents does not validate.
+ */
+ public Builder withClaim(String name, Map
+ * Accepted nested types are {@linkplain Map} and {@linkplain List} with basic types
+ * {@linkplain Boolean}, {@linkplain Integer}, {@linkplain Long}, {@linkplain Double},
+ * {@linkplain String} and {@linkplain Date}. {@linkplain Map}s cannot contain null keys or values.
+ * {@linkplain List}s can contain null elements.
+ *
+ * @param name the Claim's name.
+ * @param list the Claim's list of values.
+ * @return this same Builder instance.
+ * @throws IllegalArgumentException if the name is null, or if the list contents does not validate.
+ */
+
+ public Builder withClaim(String name, List> list) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Add specific Claims to set as the Payload. If the provided map is null then
+ * nothing is changed.
+ *
+ * Accepted types are {@linkplain Map} and {@linkplain List} with basic types
+ * {@linkplain Boolean}, {@linkplain Integer}, {@linkplain Long}, {@linkplain Double},
+ * {@linkplain String} and {@linkplain Date}. {@linkplain Map}s cannot contain null keys or values.
+ * {@linkplain List}s can contain null elements.
+ *
+ * If any of the claims are invalid, none will be added.
+ *
+ * This class and its subclasses are thread-safe.
+ */
+public abstract class Algorithm {
+
+ /**
+ * Creates a new Algorithm instance using SHA256withRSA. Tokens specify this as "RS256".
+ *
+ * @param keyProvider the provider of the Public Key and Private Key for the verify and signing instance.
+ * @return a valid RSA256 Algorithm.
+ * @throws IllegalArgumentException if the provided Key is null.
+ */
+ public static Algorithm RSA256(RSAKeyProvider keyProvider) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA256withRSA. Tokens specify this as "RS256".
+ *
+ * @param publicKey the key to use in the verify instance.
+ * @param privateKey the key to use in the signing instance.
+ * @return a valid RSA256 Algorithm.
+ * @throws IllegalArgumentException if both provided Keys are null.
+ */
+ public static Algorithm RSA256(RSAPublicKey publicKey, RSAPrivateKey privateKey) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA256withRSA. Tokens specify this as "RS256".
+ *
+ * @param key the key to use in the verify or signing instance.
+ * @return a valid RSA256 Algorithm.
+ * @throws IllegalArgumentException if the Key Provider is null.
+ * @deprecated use {@link #RSA256(RSAPublicKey, RSAPrivateKey)} or {@link #RSA256(RSAKeyProvider)}
+ */
+ @Deprecated
+ public static Algorithm RSA256(RSAKey key) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA384withRSA. Tokens specify this as "RS384".
+ *
+ * @param keyProvider the provider of the Public Key and Private Key for the verify and signing instance.
+ * @return a valid RSA384 Algorithm.
+ * @throws IllegalArgumentException if the Key Provider is null.
+ */
+ public static Algorithm RSA384(RSAKeyProvider keyProvider) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA384withRSA. Tokens specify this as "RS384".
+ *
+ * @param publicKey the key to use in the verify instance.
+ * @param privateKey the key to use in the signing instance.
+ * @return a valid RSA384 Algorithm.
+ * @throws IllegalArgumentException if both provided Keys are null.
+ */
+ public static Algorithm RSA384(RSAPublicKey publicKey, RSAPrivateKey privateKey) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA384withRSA. Tokens specify this as "RS384".
+ *
+ * @param key the key to use in the verify or signing instance.
+ * @return a valid RSA384 Algorithm.
+ * @throws IllegalArgumentException if the provided Key is null.
+ * @deprecated use {@link #RSA384(RSAPublicKey, RSAPrivateKey)} or {@link #RSA384(RSAKeyProvider)}
+ */
+ @Deprecated
+ public static Algorithm RSA384(RSAKey key) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA512withRSA. Tokens specify this as "RS512".
+ *
+ * @param keyProvider the provider of the Public Key and Private Key for the verify and signing instance.
+ * @return a valid RSA512 Algorithm.
+ * @throws IllegalArgumentException if the Key Provider is null.
+ */
+ public static Algorithm RSA512(RSAKeyProvider keyProvider) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA512withRSA. Tokens specify this as "RS512".
+ *
+ * @param publicKey the key to use in the verify instance.
+ * @param privateKey the key to use in the signing instance.
+ * @return a valid RSA512 Algorithm.
+ * @throws IllegalArgumentException if both provided Keys are null.
+ */
+ public static Algorithm RSA512(RSAPublicKey publicKey, RSAPrivateKey privateKey) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA512withRSA. Tokens specify this as "RS512".
+ *
+ * @param key the key to use in the verify or signing instance.
+ * @return a valid RSA512 Algorithm.
+ * @throws IllegalArgumentException if the provided Key is null.
+ * @deprecated use {@link #RSA512(RSAPublicKey, RSAPrivateKey)} or {@link #RSA512(RSAKeyProvider)}
+ */
+ @Deprecated
+ public static Algorithm RSA512(RSAKey key) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using HmacSHA256. Tokens specify this as "HS256".
+ *
+ * @param secret the secret to use in the verify or signing instance.
+ * @return a valid HMAC256 Algorithm.
+ * @throws IllegalArgumentException if the provided Secret is null.
+ */
+ public static Algorithm HMAC256(String secret) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using HmacSHA384. Tokens specify this as "HS384".
+ *
+ * @param secret the secret to use in the verify or signing instance.
+ * @return a valid HMAC384 Algorithm.
+ * @throws IllegalArgumentException if the provided Secret is null.
+ */
+ public static Algorithm HMAC384(String secret) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using HmacSHA512. Tokens specify this as "HS512".
+ *
+ * @param secret the secret to use in the verify or signing instance.
+ * @return a valid HMAC512 Algorithm.
+ * @throws IllegalArgumentException if the provided Secret is null.
+ */
+ public static Algorithm HMAC512(String secret) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using HmacSHA256. Tokens specify this as "HS256".
+ *
+ * @param secret the secret bytes to use in the verify or signing instance.
+ * @return a valid HMAC256 Algorithm.
+ * @throws IllegalArgumentException if the provided Secret is null.
+ */
+ public static Algorithm HMAC256(byte[] secret) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA256withECDSA. Tokens specify this as "ES256K".
+ *
+ * @param keyProvider the provider of the Public Key and Private Key for the verify and signing instance.
+ * @return a valid ECDSA256 Algorithm.
+ * @throws IllegalArgumentException if the Key Provider is null.
+ * @deprecated The SECP-256K1 Curve algorithm has been disabled beginning in Java 15.
+ * Use of this method in those unsupported Java versions will throw a {@link java.security.SignatureException}.
+ * This method will be removed in the next major version. See for additional information
+ */
+ @Deprecated
+ public static Algorithm ECDSA256K(ECDSAKeyProvider keyProvider) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA256withECDSA. Tokens specify this as "ES256K".
+ *
+ * @param publicKey the key to use in the verify instance.
+ * @param privateKey the key to use in the signing instance.
+ * @return a valid ECDSA256 Algorithm.
+ * @throws IllegalArgumentException if the provided Key is null.
+ * @deprecated The SECP-256K1 Curve algorithm has been disabled beginning in Java 15.
+ * Use of this method in those unsupported Java versions will throw a {@link java.security.SignatureException}.
+ * This method will be removed in the next major version. See for additional information
+ */
+ @Deprecated
+ public static Algorithm ECDSA256K(ECPublicKey publicKey, ECPrivateKey privateKey) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using HmacSHA384. Tokens specify this as "HS384".
+ *
+ * @param secret the secret bytes to use in the verify or signing instance.
+ * @return a valid HMAC384 Algorithm.
+ * @throws IllegalArgumentException if the provided Secret is null.
+ */
+ public static Algorithm HMAC384(byte[] secret) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using HmacSHA512. Tokens specify this as "HS512".
+ *
+ * @param secret the secret bytes to use in the verify or signing instance.
+ * @return a valid HMAC512 Algorithm.
+ * @throws IllegalArgumentException if the provided Secret is null.
+ */
+ public static Algorithm HMAC512(byte[] secret) throws IllegalArgumentException {
+ return null;
+ }
+
+
+
+ /**
+ * Creates a new Algorithm instance using SHA256withECDSA. Tokens specify this as "ES256".
+ *
+ * @param keyProvider the provider of the Public Key and Private Key for the verify and signing instance.
+ * @return a valid ECDSA256 Algorithm.
+ * @throws IllegalArgumentException if the Key Provider is null.
+ */
+ public static Algorithm ECDSA256(ECDSAKeyProvider keyProvider) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA256withECDSA. Tokens specify this as "ES256".
+ *
+ * @param publicKey the key to use in the verify instance.
+ * @param privateKey the key to use in the signing instance.
+ * @return a valid ECDSA256 Algorithm.
+ * @throws IllegalArgumentException if the provided Key is null.
+ */
+ public static Algorithm ECDSA256(ECPublicKey publicKey, ECPrivateKey privateKey) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA256withECDSA. Tokens specify this as "ES256".
+ *
+ * @param key the key to use in the verify or signing instance.
+ * @return a valid ECDSA256 Algorithm.
+ * @throws IllegalArgumentException if the provided Key is null.
+ * @deprecated use {@link #ECDSA256(ECPublicKey, ECPrivateKey)} or {@link #ECDSA256(ECDSAKeyProvider)}
+ */
+ @Deprecated
+ public static Algorithm ECDSA256(ECKey key) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA384withECDSA. Tokens specify this as "ES384".
+ *
+ * @param keyProvider the provider of the Public Key and Private Key for the verify and signing instance.
+ * @return a valid ECDSA384 Algorithm.
+ * @throws IllegalArgumentException if the Key Provider is null.
+ */
+ public static Algorithm ECDSA384(ECDSAKeyProvider keyProvider) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA384withECDSA. Tokens specify this as "ES384".
+ *
+ * @param publicKey the key to use in the verify instance.
+ * @param privateKey the key to use in the signing instance.
+ * @return a valid ECDSA384 Algorithm.
+ * @throws IllegalArgumentException if the provided Key is null.
+ */
+ public static Algorithm ECDSA384(ECPublicKey publicKey, ECPrivateKey privateKey) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA384withECDSA. Tokens specify this as "ES384".
+ *
+ * @param key the key to use in the verify or signing instance.
+ * @return a valid ECDSA384 Algorithm.
+ * @throws IllegalArgumentException if the provided Key is null.
+ * @deprecated use {@link #ECDSA384(ECPublicKey, ECPrivateKey)} or {@link #ECDSA384(ECDSAKeyProvider)}
+ */
+ @Deprecated
+ public static Algorithm ECDSA384(ECKey key) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA512withECDSA. Tokens specify this as "ES512".
+ *
+ * @param keyProvider the provider of the Public Key and Private Key for the verify and signing instance.
+ * @return a valid ECDSA512 Algorithm.
+ * @throws IllegalArgumentException if the Key Provider is null.
+ */
+ public static Algorithm ECDSA512(ECDSAKeyProvider keyProvider) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA512withECDSA. Tokens specify this as "ES512".
+ *
+ * @param publicKey the key to use in the verify instance.
+ * @param privateKey the key to use in the signing instance.
+ * @return a valid ECDSA512 Algorithm.
+ * @throws IllegalArgumentException if the provided Key is null.
+ */
+ public static Algorithm ECDSA512(ECPublicKey publicKey, ECPrivateKey privateKey) throws IllegalArgumentException {
+ return null;
+ }
+
+ /**
+ * Creates a new Algorithm instance using SHA512withECDSA. Tokens specify this as "ES512".
+ *
+ * @param key the key to use in the verify or signing instance.
+ * @return a valid ECDSA512 Algorithm.
+ * @throws IllegalArgumentException if the provided Key is null.
+ * @deprecated use {@link #ECDSA512(ECPublicKey, ECPrivateKey)} or {@link #ECDSA512(ECDSAKeyProvider)}
+ */
+ @Deprecated
+ public static Algorithm ECDSA512(ECKey key) throws IllegalArgumentException {
+ return null;
+ }
+
+
+ public static Algorithm none() {
+ return null;
+ }
+
+ /**
+ * Getter for the Id of the Private Key used to sign the tokens. This is usually specified as the `kid` claim in the Header.
+ *
+ * @return the Key Id that identifies the Signing Key or null if it's not specified.
+ */
+ public String getSigningKeyId() {
+ return null;
+ }
+
+ /**
+ * Getter for the name of this Algorithm, as defined in the JWT Standard. i.e. "HS256"
+ *
+ * @return the algorithm name.
+ */
+ public String getName() {
+ return null;
+ }
+
+ /**
+ * Getter for the description of this Algorithm, required when instantiating a Mac or Signature object. i.e. "HmacSHA256"
+ *
+ * @return the algorithm description.
+ */
+ String getDescription() {
+ return null;
+ }
+
+ /**
+ * Verify the given token using this Algorithm instance.
+ *
+ * @param jwt the already decoded JWT that it's going to be verified.
+ * @throws SignatureVerificationException if the Token's Signature is invalid, meaning that it doesn't match the signatureBytes, or if the Key is invalid.
+ */
+ public abstract void verify(DecodedJWT jwt) throws SignatureVerificationException;
+
+ /**
+ * Sign the given content using this Algorithm instance.
+ *
+ * @param headerBytes an array of bytes representing the base64 encoded header content to be verified against the signature.
+ * @param payloadBytes an array of bytes representing the base64 encoded payload content to be verified against the signature.
+ * @return the signature in a base64 encoded array of bytes
+ * @throws SignatureGenerationException if the Key is invalid.
+ */
+ public byte[] sign(byte[] headerBytes, byte[] payloadBytes) throws SignatureGenerationException {
+ return null;
+ }
+
+ /**
+ * Sign the given content using this Algorithm instance.
+ *
+ * @param contentBytes an array of bytes representing the base64 encoded content to be verified against the signature.
+ * @return the signature in a base64 encoded array of bytes
+ * @throws SignatureGenerationException if the Key is invalid.
+ * @deprecated Please use the {@linkplain #sign(byte[], byte[])} method instead.
+ */
+
+ @Deprecated
+ public abstract byte[] sign(byte[] contentBytes) throws SignatureGenerationException;
+
+}
\ No newline at end of file
diff --git a/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/exceptions/JWTCreationException.java b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/exceptions/JWTCreationException.java
new file mode 100644
index 000000000000..84644b951956
--- /dev/null
+++ b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/exceptions/JWTCreationException.java
@@ -0,0 +1,6 @@
+package com.auth0.jwt.exceptions;
+
+public class JWTCreationException extends RuntimeException {
+ public JWTCreationException(String message, Throwable cause) {
+ }
+}
\ No newline at end of file
diff --git a/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/exceptions/JWTDecodeException.java b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/exceptions/JWTDecodeException.java
new file mode 100644
index 000000000000..1fe76bb12e5f
--- /dev/null
+++ b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/exceptions/JWTDecodeException.java
@@ -0,0 +1,9 @@
+package com.auth0.jwt.exceptions;
+
+public class JWTDecodeException extends RuntimeException {
+ public JWTDecodeException(String message) {
+ }
+
+ public JWTDecodeException(String message, Throwable cause) {
+ }
+}
\ No newline at end of file
diff --git a/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/exceptions/JWTVerificationException.java b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/exceptions/JWTVerificationException.java
new file mode 100644
index 000000000000..6cb0536aa47b
--- /dev/null
+++ b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/exceptions/JWTVerificationException.java
@@ -0,0 +1,9 @@
+package com.auth0.jwt.exceptions;
+
+public class JWTVerificationException extends RuntimeException {
+ public JWTVerificationException(String message) {
+ }
+
+ public JWTVerificationException(String message, Throwable cause) {
+ }
+}
\ No newline at end of file
diff --git a/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/exceptions/SignatureGenerationException.java b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/exceptions/SignatureGenerationException.java
new file mode 100644
index 000000000000..415f8fa31890
--- /dev/null
+++ b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/exceptions/SignatureGenerationException.java
@@ -0,0 +1,8 @@
+package com.auth0.jwt.exceptions;
+
+import com.auth0.jwt.algorithms.Algorithm;
+
+public class SignatureGenerationException extends RuntimeException {
+ public SignatureGenerationException(Algorithm algorithm, Throwable cause) {
+ }
+}
\ No newline at end of file
diff --git a/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/exceptions/SignatureVerificationException.java b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/exceptions/SignatureVerificationException.java
new file mode 100644
index 000000000000..b317bd8b3ee7
--- /dev/null
+++ b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/exceptions/SignatureVerificationException.java
@@ -0,0 +1,13 @@
+
+
+package com.auth0.jwt.exceptions;
+
+import com.auth0.jwt.algorithms.Algorithm;
+
+public class SignatureVerificationException extends RuntimeException {
+ public SignatureVerificationException(Algorithm algorithm) {
+ }
+
+ public SignatureVerificationException(Algorithm algorithm, Throwable cause) {
+ }
+}
\ No newline at end of file
diff --git a/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/interfaces/DecodedJWT.java b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/interfaces/DecodedJWT.java
new file mode 100644
index 000000000000..ba0fb21963db
--- /dev/null
+++ b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/interfaces/DecodedJWT.java
@@ -0,0 +1,37 @@
+package com.auth0.jwt.interfaces;
+
+/**
+ * Class that represents a Json Web Token that was decoded from it's string representation.
+ */
+public interface DecodedJWT {
+ /**
+ * Getter for the String Token used to create this JWT instance.
+ *
+ * @return the String Token.
+ */
+ String getToken();
+
+ /**
+ * Getter for the Header contained in the JWT as a Base64 encoded String.
+ * This represents the first part of the token.
+ *
+ * @return the Header of the JWT.
+ */
+ String getHeader();
+
+ /**
+ * Getter for the Payload contained in the JWT as a Base64 encoded String.
+ * This represents the second part of the token.
+ *
+ * @return the Payload of the JWT.
+ */
+ String getPayload();
+
+ /**
+ * Getter for the Signature contained in the JWT as a Base64 encoded String.
+ * This represents the third part of the token.
+ *
+ * @return the Signature of the JWT.
+ */
+ String getSignature();
+}
\ No newline at end of file
diff --git a/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/interfaces/ECDSAKeyProvider.java b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/interfaces/ECDSAKeyProvider.java
new file mode 100644
index 000000000000..81f3382b13a9
--- /dev/null
+++ b/java/ql/test/stubs/auth0-jwt-2.3/com/auth0/jwt/interfaces/ECDSAKeyProvider.java
@@ -0,0 +1,10 @@
+package com.auth0.jwt.interfaces;
+
+import java.security.interfaces.ECPrivateKey;
+import java.security.interfaces.ECPublicKey;
+
+/**
+ * Elliptic Curve (EC) Public/Private Key provider.
+ */
+public interface ECDSAKeyProvider extends KeyProvider