Crypto-View

keycloak/keycloak

Cryptographic posture

1792 cryptographic locations: 56 already broken, 724 quantum-vulnerable, 280 reduced-margin, 413 undetermined, 319 quantum-safe

243 establish keys, so traffic protected by them and recorded today becomes readable once the algorithm falls. 18 imported cryptographic libraries are listed separately. 6993 files analysed.

Quantum-vulnerable 724 Already broken 56 Reduced margin 280 Could not be determined 413 Quantum-safe 319
To address990
Key establishment243
Inventory only18
Total findings1810
What was analysed
Branch main
Commit 0486c6c92f2c4c1ffc04026da24865885d66078a Cached organization returns identity provider models bound to the session that loaded it (Session not bound to a realm)
Committed 2026-10-23 09:08 UTC
Scanned 2026-10-23 11:20 UTC 27 days ago
Coverage 6993 files, 5393 java, 1 python, 863 javascript
4073 test files not scanned

Earlier scans of this repository

4 scans · compare any two
0 to 1000 locations Already broken 50 → 56 (up 6) Quantum-vulnerable 683 → 724 (up 41) Reduced margin 121 → 280 (up 159) Could not be determined 502 → 413 (down 89) Quantum-safe 130 → 319 (up 189) The filled point is the scan you are reading.
Scanned Commit To address Key establishment
27 days ago this scan 0486c6c92f2c main 990 243
28 days ago f7532e18737e main 932 225 Compare
28 days ago 8d2a83b10ea0 main 785 209 Compare
29 days ago 13f76e360154 743 105 Compare

A repository is scanned again when someone asks: Run a fresh scan.

List of cryptographic assets

SHA-1 Already broken 15 places See details

Hash algorithm through the JCA

`MessageDigest.getInstance()`. MD5 and SHA-1 are reported as already broken; SHA-256 is reported as a reduced margin rather than a defect.

This is already unsafe today, with no quantum computer involved. SHAttered and subsequent work produced practical collisions; NIST withdrew SHA-1 in 2030 guidance and it is already unacceptable for signatures.

What to do. SHA-256 as the floor, SHA-384 where the digest protects something that must remain verifiable for decades.

  1. core/src/main/java/org/keycloak/jose/jwk/JWK.java:137 sha1x509Thumbprint = PemUtils.generateThumbprint(x509CertificateChain, "SHA-1");
  2. core/src/main/java/org/keycloak/jose/jwk/RSAPublicJWK.java:75 sha1x509Thumbprint = PemUtils.generateThumbprint(x509CertificateChain, "SHA-1");
  3. core/src/main/java/org/keycloak/jose/jws/crypto/HashUtils.java:59 MessageDigest md = MessageDigest.getInstance(javaAlgorithmName);
  4. core/src/main/java/org/keycloak/jose/jws/crypto/HashUtils.java:61 return md.digest();
  5. distribution/downloads/src/main/java/CopyDependencies.java:93 MessageDigest sha1 = MessageDigest.getInstance("SHA-1");
  6. distribution/downloads/src/main/java/CopyDependencies.java:105 Files.writeString(file.resolveSibling(file.getFileName() + ".sha1"), hex.formatHex(sha1.digest()));
  7. saml-core/src/main/java/org/keycloak/saml/processing/core/constants/PicketLinkFederationConstants.java:27 String DSA_SIGNATURE_ALGORITHM = "SHA1withDSA";
  8. saml-core/src/main/java/org/keycloak/saml/processing/core/constants/PicketLinkFederationConstants.java:28 String RSA_SIGNATURE_ALGORITHM = "SHA1withRSA";
  9. saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/SignatureUtil.java:212 sig = Signature.getInstance(PicketLinkFederationConstants.DSA_SIGNATURE_ALGORITHM);
  10. saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/SignatureUtil.java:214 sig = Signature.getInstance(PicketLinkFederationConstants.RSA_SIGNATURE_ALGORITHM);
  11. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:29 RSA_SHA1("http://www.w3.org/2000/09/xmldsig#rsa-sha1", "http://www.w3.org/2000/09/xmldsig#sha1", "SHA1withRSA"),
  12. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:34 DSA_SHA1("http://www.w3.org/2000/09/xmldsig#dsa-sha1", "http://www.w3.org/2000/09/xmldsig#sha1", "SHA1withDSA")
  13. server-spi-private/src/main/java/org/keycloak/protocol/saml/util/ArtifactBindingUtils.java:48 MessageDigest sha1Digester = MessageDigest.getInstance("SHA-1");
  14. server-spi-private/src/main/java/org/keycloak/protocol/saml/util/ArtifactBindingUtils.java:49 return sha1Digester.digest(identifierFrom.getBytes(StandardCharsets.UTF_8));
  15. services/src/main/java/org/keycloak/services/util/DPoPUtil.java:408 String hashString = Hex.encodeHexString(HashUtils.hash("SHA1", hashKey.getBytes()));
java.messagedigest · CWE-328
RSAES-PKCS1v15 Already broken Recorded traffic 11 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

This is already unsafe today, with no quantum computer involved. PKCS#1 v1.5 encryption padding is vulnerable to Bleichenbacher oracles today, and the underlying RSA is broken by Shor.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. common/src/main/java/org/keycloak/common/crypto/CryptoConstants.java:10 public static final String RSA1_5 = "RSA1_5";
  2. core/src/main/java/org/keycloak/crypto/Algorithm.java:46 String RSA1_5 = CryptoConstants.RSA1_5;
  3. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:29 public static final String RSA1_5 = CryptoConstants.RSA1_5;
  4. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:95 providers.put(CryptoConstants.RSA1_5, new RSAWrapperAlgorithmProvider(new FIPSRsaKeyEncryptionJWEAlgorithmProvider(FipsRSA.WRAP_PKCS1v1_5)));
  5. js/apps/admin-ui/src/identity-providers/add/DescriptorSettings.tsx:265 options={["RSA-OAEP", "RSA1_5"]}
  6. services/src/main/java/org/keycloak/crypto/RsaCekManagementProvider.java:37 if (JWEConstants.RSA1_5.equals(jweAlgorithmName) || JWEConstants.RSA_OAEP.equals(jweAlgorithmName) ||
  7. services/src/main/java/org/keycloak/crypto/RsaesPkcs1CekManagementProviderFactory.java:25 public static final String ID = JWEConstants.RSA1_5;
  8. services/src/main/java/org/keycloak/keys/Attributes.java:93 JWEConstants.RSA1_5, JWEConstants.RSA_OAEP, JWEConstants.RSA_OAEP_256);
  9. services/src/main/java/org/keycloak/keys/GeneratedRsaEncKeyProviderFactory.java:71 return algorithm.equals(Algorithm.RSA1_5)
  10. services/src/main/java/org/keycloak/keys/ImportedRsaEncKeyProviderFactory.java:64 return algorithm.equals(Algorithm.RSA1_5)
  11. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:109 case Algorithm.RSA_OAEP, Algorithm.RSA1_5, Algorithm.RSA_OAEP_256 ->
jose.algorithm · CWE-327
SHA-1 Already broken 9 places See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:125 { key: "http://www.w3.org/2000/09/xmldsig#sha1", value: "SHA-1" },
  2. model/jpa/src/main/java/org/keycloak/connections/jpa/updater/liquibase/custom/JpaUpdate26_4_0_SamlEncryptionAttributes.java:38 statements.add(createInsertQueryForAttribute("saml.encryption.digestMethod", "http://www.w3.org/2000/09/xmldsig#sha1"));
  3. model/storage-private/src/main/java/org/keycloak/storage/datastore/DefaultExportImportManager.java:590 app.setAttribute("saml.encryption.digestMethod", "http://www.w3.org/2000/09/xmldsig#sha1");
  4. saml-core-api/src/main/java/org/keycloak/saml/common/constants/JBossSAMLConstants.java:231 SIGNATURE_SHA1_WITH_DSA("http://www.w3.org/2000/09/xmldsig#dsa-sha1"),
  5. saml-core-api/src/main/java/org/keycloak/saml/common/constants/JBossSAMLConstants.java:232 SIGNATURE_SHA1_WITH_RSA("http://www.w3.org/2000/09/xmldsig#rsa-sha1"),
  6. saml-core-api/src/main/java/org/keycloak/saml/common/constants/JBossSAMLURIConstants.java:86 SIGNATURE_DSA_SHA1("http://www.w3.org/2000/09/xmldsig#dsa-sha1"),
  7. saml-core-api/src/main/java/org/keycloak/saml/common/constants/JBossSAMLURIConstants.java:87 SIGNATURE_RSA_SHA1("http://www.w3.org/2000/09/xmldsig#rsa-sha1"),
  8. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:29 RSA_SHA1("http://www.w3.org/2000/09/xmldsig#rsa-sha1", "http://www.w3.org/2000/09/xmldsig#sha1", "SHA1withRSA"),
  9. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:34 DSA_SHA1("http://www.w3.org/2000/09/xmldsig#dsa-sha1", "http://www.w3.org/2000/09/xmldsig#sha1", "SHA1withDSA")
xmldsig.algorithm · CWE-327
RSAES-PKCS1v15 Already broken Recorded traffic 6 places See details

Classical public-key cipher through the JCA

`Cipher.getInstance()` with a transformation whose algorithm component is a public-key or legacy symmetric cipher. The transformation string is parsed into algorithm, mode and padding, so `RSA/ECB/PKCS1Padding` is separated from `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`.

This is already unsafe today, with no quantum computer involved. PKCS#1 v1.5 encryption padding is vulnerable to Bleichenbacher oracles today, and the underlying RSA is broken by Shor.

What to do. For RSA encryption, move to ML-KEM-768 and keep RSA-OAEP only as the classical half of a hybrid during transition.

java.cipher · CWE-327
MD5 Already broken 5 places See details

Hash algorithm through the JCA

`MessageDigest.getInstance()`. MD5 and SHA-1 are reported as already broken; SHA-256 is reported as a reduced margin rather than a defect.

This is already unsafe today, with no quantum computer involved. Practical chosen-prefix collisions exist; MD5 has no remaining security as a digest.

What to do. SHA-256 as the floor, SHA-384 where the digest protects something that must remain verifiable for decades.

  1. distribution/downloads/src/main/java/CopyDependencies.java:92 MessageDigest md5 = MessageDigest.getInstance("MD5");
  2. distribution/downloads/src/main/java/CopyDependencies.java:104 Files.writeString(file.resolveSibling(file.getFileName() + ".md5"), hex.formatHex(md5.digest()));
  3. services/src/main/java/org/keycloak/cache/ComputedKey.java:18 return new String(md.digest(), StandardCharsets.UTF_8);
  4. services/src/main/java/org/keycloak/cache/ComputedKey.java:29 return new String(md.digest(), StandardCharsets.UTF_8);
  5. services/src/main/java/org/keycloak/cache/ComputedKey.java:34 return MessageDigest.getInstance("MD5");
java.messagedigest · CWE-328
SHA-1 Already broken 4 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. crypto/default/src/main/java/org/keycloak/crypto/def/BCOCSPProvider.java:119 DigestCalculator digCalc = dcp.get(CertificateID.HASH_SHA1);
  2. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSOCSPProvider.java:118 DigestCalculator digCalc = dcp.get(CertificateID.HASH_SHA1);
  3. saml-core/src/main/java/org/keycloak/saml/processing/api/saml/v2/sig/SAML2Signature.java:57 private String digestMethod = DigestMethod.SHA1;
  4. saml-core/src/main/java/org/keycloak/saml/processing/core/util/XMLEncryptionUtil.java:189 } else if (XMLCipher.SHA1.equals(keyEncryptionDigestMethod)){
code.algorithm-constant
RSAES-PKCS1v15 Already broken Recorded traffic 2 places See details

Cipher transformation named away from the call

A JCA transformation string - `algorithm/mode/padding` - written somewhere other than a `getInstance()` argument, which is how a codebase that centralises its cryptography passes the choice to a helper. The string is unambiguous wherever it appears: nothing but a transformation is spelled that way.

This names an encryption method as text, and passes it to code elsewhere that does the work. It is the same choice, made in a different place.

What to do. The same migration applies as to the call that consumes it. Move the constant and the call together, so the inventory keeps naming the algorithm after the change.

  1. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:60 providers.put(CryptoConstants.RSA1_5, new RSAWrapperAlgorithmProvider(new DefaultRsaKeyEncryptionJWEAlgorithmProvider("RSA/ECB/PKCS1Padding")));
  2. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:61 providers.put(CryptoConstants.RSA1_5, new RSAWrapperAlgorithmProvider(new ElytronRsaKeyEncryptionJWEAlgorithmProvider("RSA/ECB/PKCS1Padding")));
java.transformation · CWE-327
RSAES-PKCS1v15 Already broken Recorded traffic 2 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

code.algorithm-constant
RSAES-PKCS1v15 Already broken 1 place See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:100 { key: "http://www.w3.org/2001/04/xmlenc#rsa-1_5", value: "RSA1_5" },
xmldsig.algorithm · CWE-327
SHA-1 Already broken 1 place See details

Algorithm named in a setting

A setting whose name says it holds an algorithm, given a literal that names one: `withOaepPaddingDigestAlgorithm("SHA-512")`, `signatureAlgorithm = "SHA256withRSA"`, `"digestAlgorithm": "SHA-256"`. The algorithm never reaches a `getInstance()` in this file - it is carried to one somewhere else, often through configuration - so a scan that only reads the factories cannot see it at all.

Something here is configured to use a named algorithm. The code that uses it may be somewhere else entirely, but this is the line that decides which algorithm it is.

What to do. Find what consumes the setting. The migration belongs to that operation; this line is where the choice is actually written down, and usually where it is easiest to change.

  1. js/apps/admin-ui/src/authentication/policies/OtpPolicy.tsx:32 const OTP_HASH_ALGORITHMS = ["SHA1", "SHA256", "SHA512"] as const;
config.algorithm-setting · CWE-327
ECDH-ES Quantum-vulnerable Recorded traffic 74 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. common/src/main/java/org/keycloak/common/crypto/CryptoConstants.java:13 public static final String ECDH_ES = "ECDH-ES";
  2. common/src/main/java/org/keycloak/common/crypto/CryptoConstants.java:14 public static final String ECDH_ES_A128KW = "ECDH-ES+A128KW";
  3. common/src/main/java/org/keycloak/common/crypto/CryptoConstants.java:15 public static final String ECDH_ES_A192KW = "ECDH-ES+A192KW";
  4. common/src/main/java/org/keycloak/common/crypto/CryptoConstants.java:16 public static final String ECDH_ES_A256KW = "ECDH-ES+A256KW";
  5. core/src/main/java/org/keycloak/crypto/Algorithm.java:53 String ECDH_ES = CryptoConstants.ECDH_ES;
  6. core/src/main/java/org/keycloak/crypto/Algorithm.java:54 String ECDH_ES_A128KW = CryptoConstants.ECDH_ES_A128KW;
  7. core/src/main/java/org/keycloak/crypto/Algorithm.java:55 String ECDH_ES_A192KW = CryptoConstants.ECDH_ES_A192KW;
  8. core/src/main/java/org/keycloak/crypto/Algorithm.java:56 String ECDH_ES_A256KW = CryptoConstants.ECDH_ES_A256KW;
  9. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:32 public static final String ECDH_ES = CryptoConstants.ECDH_ES;
  10. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:33 public static final String ECDH_ES_A128KW = CryptoConstants.ECDH_ES_A128KW;
  11. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:34 public static final String ECDH_ES_A192KW = CryptoConstants.ECDH_ES_A192KW;
  12. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:35 public static final String ECDH_ES_A256KW = CryptoConstants.ECDH_ES_A256KW;
  13. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:83 if (Algorithm.ECDH_ES.equals(header.getAlgorithm())) {
  14. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:114 if (Algorithm.ECDH_ES.equals(header.getAlgorithm())) {
  15. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:222 if (Algorithm.ECDH_ES_A128KW.equals(alg) || Algorithm.ECDH_ES_A192KW.equals(alg)
  16. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:223 || Algorithm.ECDH_ES_A256KW.equals(alg)) {
  17. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:225 } else if (Algorithm.ECDH_ES.equals(alg)) {
  18. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:246 if (Algorithm.ECDH_ES_A128KW.equals(alg)) {
  19. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:248 } else if (Algorithm.ECDH_ES_A192KW.equals(alg)) {
  20. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:250 } else if (Algorithm.ECDH_ES_A256KW.equals(alg)) {
  21. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:252 } else if (Algorithm.ECDH_ES.equals(alg)) {
  22. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:63 providers.put(CryptoConstants.ECDH_ES, new BCEcdhEsAlgorithmProvider());
  23. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:64 providers.put(CryptoConstants.ECDH_ES_A128KW, new BCEcdhEsAlgorithmProvider());
  24. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:65 providers.put(CryptoConstants.ECDH_ES_A192KW, new BCEcdhEsAlgorithmProvider());
  25. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:66 providers.put(CryptoConstants.ECDH_ES_A256KW, new BCEcdhEsAlgorithmProvider());
  26. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:76 if (Algorithm.ECDH_ES.equals(header.getAlgorithm())) {
  27. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:107 if (Algorithm.ECDH_ES.equals(header.getAlgorithm())) {
  28. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:190 if (Algorithm.ECDH_ES_A128KW.equals(alg) || Algorithm.ECDH_ES_A192KW.equals(alg)
  29. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:191 || Algorithm.ECDH_ES_A256KW.equals(alg)) {
  30. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:193 } else if (Algorithm.ECDH_ES.equals(alg)) {
  31. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:201 if (Algorithm.ECDH_ES_A128KW.equals(alg)) {
  32. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:203 } else if (Algorithm.ECDH_ES_A192KW.equals(alg)) {
  33. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:205 } else if (Algorithm.ECDH_ES_A256KW.equals(alg)) {
  34. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:207 } else if (Algorithm.ECDH_ES.equals(alg)) {
  35. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:242 if (Algorithm.ECDH_ES_A128KW.equals(alg)) {
  36. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:244 } else if (Algorithm.ECDH_ES_A192KW.equals(alg)) {
  37. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:246 } else if (Algorithm.ECDH_ES_A256KW.equals(alg)) {
  38. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:64 providers.put(CryptoConstants.ECDH_ES, new ElytronEcdhEsAlgorithmProvider());
  39. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:65 providers.put(CryptoConstants.ECDH_ES_A128KW, new ElytronEcdhEsAlgorithmProvider());
  40. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:66 providers.put(CryptoConstants.ECDH_ES_A192KW, new ElytronEcdhEsAlgorithmProvider());
  41. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:67 providers.put(CryptoConstants.ECDH_ES_A256KW, new ElytronEcdhEsAlgorithmProvider());
  42. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:89 if (Algorithm.ECDH_ES.equals(header.getAlgorithm())) {
  43. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:122 if (Algorithm.ECDH_ES.equals(header.getAlgorithm())) {
  44. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:220 if (Algorithm.ECDH_ES_A128KW.equals(alg) || Algorithm.ECDH_ES_A192KW.equals(alg)
  45. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:221 || Algorithm.ECDH_ES_A256KW.equals(alg)) {
  46. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:223 } else if (Algorithm.ECDH_ES.equals(alg)) {
  47. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:231 if (Algorithm.ECDH_ES_A128KW.equals(alg)) {
  48. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:233 } else if (Algorithm.ECDH_ES_A192KW.equals(alg)) {
  49. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:235 } else if (Algorithm.ECDH_ES_A256KW.equals(alg)) {
  50. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:237 } else if (Algorithm.ECDH_ES.equals(alg)) {
  51. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:98 providers.put(CryptoConstants.ECDH_ES, new BCFIPSEcdhEsAlgorithmProvider());
  52. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:99 providers.put(CryptoConstants.ECDH_ES_A128KW, new BCFIPSEcdhEsAlgorithmProvider());
  53. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:100 providers.put(CryptoConstants.ECDH_ES_A192KW, new BCFIPSEcdhEsAlgorithmProvider());
  54. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:101 providers.put(CryptoConstants.ECDH_ES_A256KW, new BCFIPSEcdhEsAlgorithmProvider());
  55. services/src/main/java/org/keycloak/broker/oid4vp/ResponseEncryption.java:38 public static final String KEY_MANAGEMENT_ALG = JWEConstants.ECDH_ES;
  56. services/src/main/java/org/keycloak/crypto/EcdhEsA128KwCekManagementProviderFactory.java:25 public static final String ID = JWEConstants.ECDH_ES_A128KW;
  57. services/src/main/java/org/keycloak/crypto/EcdhEsA192KwCekManagementProviderFactory.java:25 public static final String ID = JWEConstants.ECDH_ES_A192KW;
  58. services/src/main/java/org/keycloak/crypto/EcdhEsA256KwCekManagementProviderFactory.java:25 public static final String ID = JWEConstants.ECDH_ES_A256KW;
  59. services/src/main/java/org/keycloak/crypto/EcdhEsCekManagementProviderFactory.java:25 public static final String ID = JWEConstants.ECDH_ES;
  60. services/src/main/java/org/keycloak/crypto/EcdhEsCekManagementProvider.java:37 if (JWEConstants.ECDH_ES.equals(jweAlgorithmName) || JWEConstants.ECDH_ES_A128KW.equals(jweAlgorithmName)
  61. services/src/main/java/org/keycloak/crypto/EcdhEsCekManagementProvider.java:38 || JWEConstants.ECDH_ES_A192KW.equals(jweAlgorithmName)
  62. services/src/main/java/org/keycloak/crypto/EcdhEsCekManagementProvider.java:39 || JWEConstants.ECDH_ES_A256KW.equals(jweAlgorithmName)) {
  63. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:48 "Algorithm", "Algorithm for processing the Content Encryption Key", LIST_TYPE, Algorithm.ECDH_ES,
  64. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:49 Algorithm.ECDH_ES, Algorithm.ECDH_ES_A128KW, Algorithm.ECDH_ES_A192KW, Algorithm.ECDH_ES_A256KW);
  65. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:65 return Algorithm.ECDH_ES_A128KW;
  66. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:67 return Algorithm.ECDH_ES_A192KW;
  67. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:69 return Algorithm.ECDH_ES_A256KW;
  68. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:77 case Algorithm.ECDH_ES_A128KW :
  69. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:79 case Algorithm.ECDH_ES_A192KW :
  70. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:81 case Algorithm.ECDH_ES_A256KW :
  71. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:110 if (Algorithm.ECDH_ES.equals(algorithm)) {
  72. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:148 return (algorithm.equals(Algorithm.ECDH_ES) || algorithm.equals(Algorithm.ECDH_ES_A128KW)
  73. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:149 || algorithm.equals(Algorithm.ECDH_ES_A192KW) || algorithm.equals(Algorithm.ECDH_ES_A256KW));
  74. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:113 case Algorithm.ECDH_ES, Algorithm.ECDH_ES_A128KW, Algorithm.ECDH_ES_A192KW, Algorithm.ECDH_ES_A256KW ->
jose.algorithm · CWE-327
RSASSA-PKCS1-SHA256 Quantum-vulnerable 44 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer. The v1.5 signature scheme of RFC 8017 section 8.2 has no classical break of its own; RSA-PSS is preferred for new work, but the quantum exposure is the same for both.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:27 String RS256 = "RS256";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:49 case Algorithm.RS256:
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:91 case Algorithm.RS256:
  4. core/src/main/java/org/keycloak/crypto/KeyWrapper.java:112 return Algorithm.RS256;
  5. core/src/main/java/org/keycloak/jose/jwk/JWKBuilder.java:82 this.algorithm = Algorithm.RS256;
  6. core/src/main/java/org/keycloak/jose/jwk/RSAPublicJWK.java:33 public static final String RS256 = "RS256";
  7. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:206 return sign(Algorithm.RS256, privateKey);
  8. core/src/main/java/org/keycloak/protocol/oidc/client/authentication/JWTClientCredentialsProvider.java:62 setupKeyPair(keyPair, Algorithm.RS256);
  9. core/src/main/java/org/keycloak/protocol/oidc/client/authentication/JWTClientCredentialsProvider.java:145 String algorithm = (String) cfg.getOrDefault("algorithm", Algorithm.RS256);
  10. js/apps/admin-ui/src/authentication/policies/WebauthnPolicy.tsx:42 "RS256",
  11. js/apps/admin-ui/src/realm-settings/TokensTab.tsx:134 defaultValue={"RS256"}
  12. js/apps/admin-ui/src/realm-settings/TokensTab.tsx:722 defaultValue: "RS256",
  13. server-spi-private/src/main/java/org/keycloak/models/Constants.java:68 public static final String DEFAULT_SIGNATURE_ALGORITHM = Algorithm.RS256;
  14. server-spi-private/src/main/java/org/keycloak/models/Constants.java:91 public static final String DEFAULT_WEBAUTHN_POLICY_SIGNATURE_ALGORITHMS = Algorithm.ES256+","+Algorithm.RS256;
  15. server-spi/src/main/java/org/keycloak/models/WebAuthnPolicy.java:57 public static WebAuthnPolicy DEFAULT_POLICY = new WebAuthnPolicy(new ArrayList<>(Arrays.asList(Algorithm.ES256,Algorithm.RS256)));
  16. services/src/main/java/org/keycloak/authentication/requiredactions/WebAuthnRegister.java:423 case Algorithm.RS256 :
  17. services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java:980 String alg = getConfig().getClientAssertionSigningAlg() != null ? getConfig().getClientAssertionSigningAlg() : Algorithm.RS256;
  18. services/src/main/java/org/keycloak/broker/saml/SAMLIdentityProvider.java:416 List<KeyDescriptorType> signingKeys = session.keys().getKeysStream(realm, KeyUse.SIG, Algorithm.RS256)
  19. services/src/main/java/org/keycloak/broker/saml/SAMLIdentityProvider.java:507 KeyWrapper keyWrapper = session.keys().getActiveKey(realm, KeyUse.SIG, Algorithm.RS256);
  20. services/src/main/java/org/keycloak/crypto/RS256ClientSignatureVerifierProviderFactory.java:23 public static final String ID = Algorithm.RS256;
  21. services/src/main/java/org/keycloak/crypto/RS256ClientSignatureVerifierProviderFactory.java:32 return new AsymmetricClientSignatureVerifierProvider(session, Algorithm.RS256);
  22. services/src/main/java/org/keycloak/crypto/RS256SignatureProviderFactory.java:25 public static final String ID = Algorithm.RS256;
  23. services/src/main/java/org/keycloak/crypto/RS256SignatureProviderFactory.java:34 return new AsymmetricSignatureProvider(session, Algorithm.RS256);
  24. services/src/main/java/org/keycloak/keys/AbstractRsaKeyProvider.java:56 String defaultAlgorithmKey = KeyUse.ENC.name().equals(model.get(Attributes.KEY_USE)) ? JWEConstants.RSA_OAEP : Algorithm.RS256;
  25. services/src/main/java/org/keycloak/keys/Attributes.java:84 Algorithm.RS256,
  26. services/src/main/java/org/keycloak/keys/Attributes.java:85 Algorithm.RS256, Algorithm.RS384, Algorithm.RS512, Algorithm.PS256, Algorithm.PS384, Algorithm.PS512);
  27. services/src/main/java/org/keycloak/keys/DefaultKeyManager.java:155 KeyWrapper key = getActiveKey(realm, KeyUse.SIG, Algorithm.RS256);
  28. services/src/main/java/org/keycloak/keys/DefaultKeyManager.java:176 KeyWrapper key = getKey(realm, kid, KeyUse.SIG, Algorithm.RS256);
  29. services/src/main/java/org/keycloak/keys/DefaultKeyManager.java:183 KeyWrapper key = getKey(realm, kid, KeyUse.SIG, Algorithm.RS256);
  30. services/src/main/java/org/keycloak/keys/DefaultKeyManager.java:204 return getKeysStream(realm, KeyUse.SIG, Algorithm.RS256)
  31. services/src/main/java/org/keycloak/keys/GeneratedRsaKeyProviderFactory.java:74 return algorithm.equals(Algorithm.RS256)
  32. services/src/main/java/org/keycloak/keys/ImportedRsaKeyProviderFactory.java:67 return algorithm.equals(Algorithm.RS256)
  33. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:82 String defaultAlgorithmKey = KeyUse.ENC.name().equalsIgnoreCase(model.get(Attributes.KEY_USE)) ? JWEConstants.RSA_OAEP : Algorithm.RS256;
  34. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:107 case Algorithm.PS256, Algorithm.PS384, Algorithm.PS512, Algorithm.RS256, Algorithm.RS384, Algorithm.RS512 ->
  35. services/src/main/java/org/keycloak/protocol/oid4vc/issuance/keybinding/JwtCNonceHandler.java:287 signingKey = keycloakSession.keys().getActiveKey(realm, KeyUse.SIG, Algorithm.RS256);
  36. services/src/main/java/org/keycloak/protocol/oidc/OIDCWellKnownProvider.java:85 public static final List<String> DEFAULT_CLIENT_AUTH_SIGNING_ALG_VALUES_SUPPORTED = list(Algorithm.RS256.toString());
  37. services/src/main/java/org/keycloak/protocol/saml/SamlProtocol.java:544 KeyWrapper keyPair = keyManager.getActiveKey(realm, KeyUse.SIG, Algorithm.RS256);
  38. services/src/main/java/org/keycloak/protocol/saml/SamlService.java:1012 List<KeyWrapper> keys = session.keys().getKeysStream(realm, KeyUse.SIG, Algorithm.RS256)
  39. services/src/main/java/org/keycloak/services/clientregistration/oidc/DescriptionConverter.java:417 if (Algorithm.RS256.equals(defaultSignatureAlgorithm) || StringUtil.isBlank(defaultSignatureAlgorithm)) {
  40. ssf/transmitter/src/main/java/org/keycloak/ssf/transmitter/event/SsfSignatureAlgorithms.java:31 public static final Set<String> ALLOWED = Set.of(Algorithm.RS256);
  41. ssf/transmitter/src/main/java/org/keycloak/ssf/transmitter/event/SsfSignatureAlgorithms.java:38 public static final String DEFAULT = Algorithm.RS256;
  42. ssf/transmitter/src/main/java/org/keycloak/ssf/transmitter/SsfTransmitterConfig.java:112 public static final String DEFAULT_SIGNATURE_ALGORITHM = Algorithm.RS256;
  43. ssf/transmitter/src/main/java/org/keycloak/ssf/transmitter/SsfTransmitterConfig.java:268 DEFAULT_SIGNATURE_ALGORITHM),
  44. ssf/transmitter/src/main/java/org/keycloak/ssf/transmitter/SsfTransmitterConfig.java:318 DEFAULT_SIGNATURE_ALGORITHM,
jose.algorithm · CWE-327
Ed25519255-bitother/Ed25519 Quantum-vulnerable 37 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:40 String EdDSA = "EdDSA";
  2. core/src/main/java/org/keycloak/crypto/Algorithm.java:42 String Ed25519 = "Ed25519";
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:33 public static final String Ed25519 = "Ed25519";
  4. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:73 case Algorithm.EdDSA:
  5. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:77 return Ed25519;
  6. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:115 case Algorithm.EdDSA:
  7. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:118 case Algorithm.Ed25519:
  8. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:141 case Algorithm.EdDSA:
  9. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:143 case Algorithm.Ed25519:
  10. core/src/main/java/org/keycloak/crypto/KeyWrapper.java:114 return Algorithm.EdDSA;
  11. core/src/main/java/org/keycloak/jose/jwk/EdECUtilsImpl.java:78 if (Algorithm.Ed25519.equals(crv)) {
  12. core/src/main/java/org/keycloak/jose/jwk/EdECUtilsImpl.java:121 if (Algorithm.Ed25519.equals(eddsaPublicKey.getParams().getName())) {
  13. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:116 if (org.keycloak.crypto.Algorithm.Ed25519.equals(sigAlgName) || org.keycloak.crypto.Algorithm.Ed448.equals(sigAlgName)) {
  14. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:117 builder.append("\"alg\":\"").append(org.keycloak.crypto.Algorithm.EdDSA).append("\"");
  15. core/src/main/java/org/keycloak/mdoc/MdocDeviceKey.java:123 if (!Algorithm.Ed25519.equals(okp.getCrv())) {
  16. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:210 case JavaAlgorithm.Ed25519:
  17. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:212 case JavaAlgorithm.Ed25519:
  18. js/apps/admin-ui/src/authentication/policies/WebauthnPolicy.tsx:45 "Ed25519",
  19. services/src/main/java/org/keycloak/authentication/requiredactions/WebAuthnRegister.java:438 case Algorithm.Ed25519:
  20. services/src/main/java/org/keycloak/crypto/EdDSAClientSignatureVerifierProviderFactory.java:27 public static final String ID = Algorithm.EdDSA;
  21. services/src/main/java/org/keycloak/crypto/EdDSAClientSignatureVerifierProviderFactory.java:36 return new EdDSAClientSignatureVerifierProvider(session, Algorithm.EdDSA);
  22. services/src/main/java/org/keycloak/crypto/EdDSASignatureProviderFactory.java:28 public static final String ID = Algorithm.EdDSA;
  23. services/src/main/java/org/keycloak/crypto/EdDSASignatureProvider.java:36 return new ServerEdDSASignatureSignerContext(session, Algorithm.EdDSA);
  24. services/src/main/java/org/keycloak/crypto/EdDSASignatureProvider.java:41 SignatureProvider.checkKeyForSignature(key, Algorithm.EdDSA, KeyType.OKP);
  25. services/src/main/java/org/keycloak/crypto/EdDSASignatureProvider.java:47 return new ServerEdDSASignatureVerifierContext(session, kid, Algorithm.EdDSA);
  26. services/src/main/java/org/keycloak/crypto/EdDSASignatureProvider.java:52 SignatureProvider.checkKeyForVerification(key, Algorithm.EdDSA, KeyType.OKP);
  27. services/src/main/java/org/keycloak/keys/AbstractEddsaKeyProviderFactory.java:38 public static final String DEFAULT_EDDSA_ELLIPTIC_CURVE = Algorithm.Ed25519;
  28. services/src/main/java/org/keycloak/keys/AbstractEddsaKeyProviderFactory.java:42 String.valueOf(DEFAULT_EDDSA_ELLIPTIC_CURVE), Algorithm.Ed25519, Algorithm.Ed448);
  29. services/src/main/java/org/keycloak/keys/AbstractEddsaKeyProvider.java:70 key.setAlgorithm(Algorithm.EdDSA);
  30. services/src/main/java/org/keycloak/keys/GeneratedEddsaKeyProviderFactory.java:50 public static final String DEFAULT_EDDSA_ELLIPTIC_CURVE = Algorithm.Ed25519;
  31. services/src/main/java/org/keycloak/keys/GeneratedEddsaKeyProviderFactory.java:63 if (keyUse.equals(KeyUse.SIG) && algorithm.equals(Algorithm.EdDSA)) {
  32. services/src/main/java/org/keycloak/keys/GeneratedEddsaKeyProviderFactory.java:135 KeyFactory kf = KeyFactory.getInstance("EdDSA");
  33. services/src/main/java/org/keycloak/keys/GeneratedEddsaKeyProvider.java:51 KeyFactory kf = KeyFactory.getInstance("EdDSA");
  34. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProviderFactory.java:193 List.of(Algorithm.AES, Algorithm.EdDSA),
  35. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:115 case Algorithm.EdDSA ->
  36. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:197 JavaAlgorithm.getJavaAlgorithmForHash(Algorithm.EdDSA, privateKey.getParams().getName());
  37. services/src/main/java/org/keycloak/keys/loader/HardcodedPublicKeyLoader.java:57 kw.setPublicKey(PemUtils.decodePublicKey(encodedKey, Algorithm.EdDSA));
jose.algorithm · CWE-327
ECDSA-P256 Quantum-vulnerable 34 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:35 String ES256 = "ES256";
  2. core/src/main/java/org/keycloak/crypto/ECDSAAlgorithm.java:28 ES256(64),
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:61 case Algorithm.ES256:
  4. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:103 case Algorithm.ES256:
  5. core/src/main/java/org/keycloak/crypto/KeyWrapper.java:101 return Algorithm.ES256;
  6. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:40 ES256(AlgorithmType.ECDSA, null),
  7. js/apps/admin-ui/maven-resources-community/theme/keycloak.v2/admin/messages/messages_cs.properties:3678 credentialSigningAlgorithmHelp=Podepisovací algoritmus používaný k výběru aktivního klíče realmu propodepisování pověření (např. "ES256"). Pokud není zadáno, aktivní klíč budevybrán pomocí výchozího algoritmu realmu. Tato možnost je zakázán
  8. js/apps/admin-ui/maven-resources-community/theme/keycloak.v2/admin/messages/messages_es.properties:3727 credentialSigningAlgorithmHelp=Algoritmo de firma utilizado para seleccionar la clave de realm activa para firmar credenciales (p. ej., "ES256"). Si no se especifica, la clave activa se seleccionará mediante el algoritmo predeterminado del
  9. js/apps/admin-ui/maven-resources-community/theme/keycloak.v2/admin/messages/messages_fr.properties:3669 credentialSigningAlgorithmHelp=L'algorithme de signature utilisé pour sélectionner la clé active du domaine pour la signature des identifiants (par exemple "ES256"). Si non spécifié, la clé active sera sélectionnée à l'aide de l'algorithme
  10. js/apps/admin-ui/maven-resources-community/theme/keycloak.v2/admin/messages/messages_id.properties:3993 credentialSigningAlgorithmHelp=Algoritme penandatanganan yang digunakan untuk memilih kunci realm aktif untuk menandatangani kredensial (misalnya, "ES256"). Jika tidak ditentukan, kunci aktif akan dipilih menggunakan algoritme default realm
  11. js/apps/admin-ui/maven-resources-community/theme/keycloak.v2/admin/messages/messages_pt_BR.properties:4008 credentialSigningAlgorithmHelp=Algoritmo de assinatura usado para selecionar a chave de realm ativo para assinatura de credenciais (por exemplo, "ES256"). Se não for especificado, a chave ativa será selecionada usando o algoritmo padrão da
  12. js/apps/admin-ui/maven-resources-community/theme/keycloak.v2/admin/messages/messages_sv.properties:3661 credentialSigningAlgorithmHelp=Signeringsalgoritm som används för att välja aktiv realm-nyckel för signering av autentiseringsuppgifter (t.ex. "ES256"). Om inget anges väljs den aktiva nyckeln med hjälp av domänens standardalgoritm. Detta a
  13. js/apps/admin-ui/maven-resources-community/theme/keycloak.v2/admin/messages/messages_tr.properties:3669 credentialSigningAlgorithmHelp=Kimlik bilgilerini imzalamak için aktif realm anahtarını seçmek üzere kullanılan imzalama algoritmasıdır (örneğin, "ES256"). Belirtilmezse, realm'in varsayılan algoritması kullanılarak aktif anahtar seçilir. B
  14. js/apps/admin-ui/maven-resources-community/theme/keycloak.v2/admin/messages/messages_uk.properties:3711 credentialSigningAlgorithmHelp=Алгоритм підпису, що використовується для вибору активного ключа області для підпису облікових даних (наприклад, "ES256"). Якщо не указано, активний ключ буде вибрано за допомогою алгоритму області за замовчув
  15. js/apps/admin-ui/maven-resources-community/theme/keycloak.v2/admin/messages/messages_vi.properties:3689 credentialSigningAlgorithmHelp=Thuật toán ký dùng để chọn khóa realm hoạt động để ký credential (ví dụ "ES256"). Nếu không chỉ định, khóa hoạt động sẽ được chọn bằng thuật toán mặc định của realm. Tùy chọn này bị tắt nếu chọn 'Signing Key I
  16. js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:4142 credentialSigningAlgorithmHelp=Signing algorithm used to select the active realm key for signing credentials (e.g., "ES256"). If not specified, the active key will be selected using the realm's default algorithm. This option is disabled if
  17. js/apps/admin-ui/src/authentication/policies/WebauthnPolicy.tsx:39 "ES256",
  18. server-spi-private/src/main/java/org/keycloak/models/Constants.java:91 public static final String DEFAULT_WEBAUTHN_POLICY_SIGNATURE_ALGORITHMS = Algorithm.ES256+","+Algorithm.RS256;
  19. server-spi/src/main/java/org/keycloak/models/WebAuthnPolicy.java:57 public static WebAuthnPolicy DEFAULT_POLICY = new WebAuthnPolicy(new ArrayList<>(Arrays.asList(Algorithm.ES256,Algorithm.RS256)));
  20. services/src/main/java/org/keycloak/authentication/requiredactions/WebAuthnRegister.java:420 case Algorithm.ES256 :
  21. services/src/main/java/org/keycloak/broker/oid4vp/OID4VPIdentityProvider.java:85 public static final List<String> ACCEPTED_ALGORITHMS = List.of(Algorithm.ES256);
  22. services/src/main/java/org/keycloak/broker/oid4vp/OID4VPIdentityProvider.java:210 ? session.keys().getKeyIncludingDisabled(realm, kid, KeyUse.SIG, Algorithm.ES256)
  23. services/src/main/java/org/keycloak/broker/oid4vp/OID4VPIdentityProvider.java:211 : session.keys().getActiveKey(realm, KeyUse.SIG, Algorithm.ES256);
  24. services/src/main/java/org/keycloak/crypto/ES256ClientSignatureVerifierProviderFactory.java:23 public static final String ID = Algorithm.ES256;
  25. services/src/main/java/org/keycloak/crypto/ES256ClientSignatureVerifierProviderFactory.java:32 return new ECDSAClientSignatureVerifierProvider(session, Algorithm.ES256);
  26. services/src/main/java/org/keycloak/crypto/ES256SignatureProviderFactory.java:25 public static final String ID = Algorithm.ES256;
  27. services/src/main/java/org/keycloak/crypto/ES256SignatureProviderFactory.java:34 return new ECDSASignatureProvider(session, Algorithm.ES256);
  28. services/src/main/java/org/keycloak/keys/GeneratedEcdsaKeyProviderFactory.java:87 return (algorithm.equals(Algorithm.ES256) || algorithm.equals(Algorithm.ES384)
  29. services/src/main/java/org/keycloak/keys/GeneratedEcdsaKeyProviderFactory.java:124 return Algorithm.ES256;
  30. services/src/main/java/org/keycloak/keys/GeneratedEcdsaKeyProviderFactory.java:136 case Algorithm.ES256 :
  31. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProviderFactory.java:194 List.of(Algorithm.ES256, Algorithm.ES384, Algorithm.ES512),
  32. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:111 case Algorithm.ES256, Algorithm.ES384, Algorithm.ES512 ->
  33. services/src/main/java/org/keycloak/protocol/oid4vc/issuance/keybinding/JwtCNonceHandler.java:281 signingKey = keycloakSession.keys().getActiveKey(realm, KeyUse.SIG, Algorithm.ES256);
  34. services/src/main/java/org/keycloak/services/clientpolicy/executor/FapiConstant.java:34 Algorithm.ES256,
jose.algorithm · CWE-327
RSA Quantum-vulnerable Recorded traffic 33 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. core/src/main/java/org/keycloak/crypto/X509CertificateChainValidator.java:120 return JWKBuilder.create().algorithm(algorithm).rsa((RSAPublicKey) key, certificateChain);
  2. core/src/main/java/org/keycloak/jose/jwk/JWKBuilder.java:83 return rsa(key);
  3. core/src/main/java/org/keycloak/jose/jwk/JWKBuilder.java:114 RSAPublicJWK k = new RSAPublicJWK();
  4. core/src/main/java/org/keycloak/jose/jwk/JWKParser.java:79 return createRSAPublicKey(normalizedJwk);
  5. core/src/main/java/org/keycloak/mdoc/MdocDeviceKey.java:65 return new MdocDeviceKey(rsaKey(keyId, algorithm, asRsaPublicKey(rsaPublicKey)));
  6. core/src/main/java/org/keycloak/RSATokenVerifier.java:40 return new RSATokenVerifier(tokenString);
  7. core/src/main/java/org/keycloak/util/DPoPGenerator.java:51 JWK jwkRsa = createRsaJwk(rsaKeyPair.getPublic());
  8. core/src/main/java/org/keycloak/util/DPoPGenerator.java:59 return JWKBuilder.create().rsa(publicKey, KeyUse.SIG);
  9. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSPemUtilsProvider.java:102 String rsaPem = PemUtils.addRsaPrivateKeyBeginEnd(pem);
  10. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPSRsaKeyEncryptionJWEAlgorithmProvider.java:35 new AsymmetricRSAPrivateKey(FipsRSA.ALGORITHM, privateKey.getEncoded());
  11. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPSRsaKeyEncryptionJWEAlgorithmProvider.java:49 new AsymmetricRSAPublicKey(FipsRSA.ALGORITHM, publicKey.getEncoded());
  12. integration/admin-client-core/src/main/java/org/keycloak/admin/client/resource/DPoPAuthFilter.java:48 String dpop = DPoPGenerator.generateRsaSignedDPoPProof(tokenManager.getDpopKeyPair(), requestContext.getMethod(), requestUri, null);
  13. integration/admin-client-core/src/main/java/org/keycloak/admin/client/resource/DPoPAuthFilter.java:54 String dpop = DPoPGenerator.generateRsaSignedDPoPProof(tokenManager.getDpopKeyPair(), requestContext.getMethod(), requestUri, accessToken);
  14. integration/admin-client-core/src/main/java/org/keycloak/admin/client/token/TokenManager.java:65 this.dpopKeyPair = KeyUtils.generateRsaKeyPair(2048);
  15. model/infinispan/src/main/java/org/keycloak/jgroups/certificates/Utils.java:58 var keyPair = KeyUtils.generateRsaKeyPair(2048);
  16. saml-core/src/main/java/org/keycloak/saml/processing/core/parsers/saml/xmldsig/KeyInfoParser.java:58 keyValue = RsaKeyValueParser.getInstance().parse(xmlEventReader);
  17. saml-core/src/main/java/org/keycloak/saml/processing/core/parsers/saml/xmldsig/RsaKeyValueParser.java:29 public static final RsaKeyValueParser INSTANCE = new RsaKeyValueParser();
  18. server-spi-private/src/main/java/org/keycloak/models/utils/DefaultKeyProviders.java:38 createRsaKeyProvider("rsa-generated", realm);
  19. server-spi-private/src/main/java/org/keycloak/models/utils/DefaultKeyProviders.java:42 createRsaEncKeyProvider("rsa-enc-generated", realm);
  20. server-spi-private/src/main/java/org/keycloak/models/utils/KeycloakModelUtils.java:247 KeyPair keyPair = KeyUtils.generateRsaKeyPair(keysize);
  21. services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java:925 RSAPublicJWK jwk = (RSAPublicJWK) builder.rsa(key.getPublicKey(), certificates, key.getUse());
  22. services/src/main/java/org/keycloak/crypto/RsaesOaep256CekManagementProviderFactory.java:34 return new RsaCekManagementProvider(session, ID);
  23. services/src/main/java/org/keycloak/crypto/RsaesOaepCekManagementProviderFactory.java:34 return new RsaCekManagementProvider(session, ID);
  24. services/src/main/java/org/keycloak/crypto/RsaesPkcs1CekManagementProviderFactory.java:34 return new RsaCekManagementProvider(session, ID);
  25. services/src/main/java/org/keycloak/keys/AbstractGeneratedRsaKeyProviderFactory.java:119 keyPair = KeyUtils.generateRsaKeyPair(size);
  26. services/src/main/java/org/keycloak/keys/DefaultKeyManager.java:156 return new ActiveRsaKey(key);
  27. services/src/main/java/org/keycloak/keys/GeneratedRsaEncKeyProviderFactory.java:44 return new ImportedRsaKeyProvider(session.getContext().getRealm(), model);
  28. services/src/main/java/org/keycloak/keys/GeneratedRsaKeyProviderFactory.java:47 return new AbstractRsaKeyProvider(session.getContext().getRealm(), model){};
  29. services/src/main/java/org/keycloak/keys/ImportedRsaEncKeyProviderFactory.java:44 return new ImportedRsaKeyProvider(session.getContext().getRealm(), model);
  30. services/src/main/java/org/keycloak/keys/ImportedRsaKeyProviderFactory.java:47 return new ImportedRsaKeyProvider(session.getContext().getRealm(), model);
  31. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:108 loadRSAKey(keyStore, keyAlias, KeyUse.SIG);
  32. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:110 loadRSAKey(keyStore, keyAlias, KeyUse.ENC);
  33. services/src/main/java/org/keycloak/protocol/oidc/utils/JWKSServerUtils.java:60 return b.rsa(key.getPublicKey(), certificates, key.getUse());
code.named-call
RSASSA-PSS-SHA256 Quantum-vulnerable 32 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:30 String PS256 = "PS256";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:67 case Algorithm.PS256:
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:109 case Algorithm.PS256:
  4. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:37 PS256(AlgorithmType.RSA, null),
  5. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:183 case JavaAlgorithm.PS256, JavaAlgorithm.PS384, JavaAlgorithm.PS512:
  6. services/src/main/java/org/keycloak/crypto/PS256ClientSignatureVerifierProviderFactory.java:23 public static final String ID = Algorithm.PS256;
  7. services/src/main/java/org/keycloak/crypto/PS256ClientSignatureVerifierProviderFactory.java:32 return new AsymmetricClientSignatureVerifierProvider(session, Algorithm.PS256);
  8. services/src/main/java/org/keycloak/crypto/PS256SignatureProviderFactory.java:25 public static final String ID = Algorithm.PS256;
  9. services/src/main/java/org/keycloak/crypto/PS256SignatureProviderFactory.java:34 return new AsymmetricSignatureProvider(session, Algorithm.PS256);
  10. services/src/main/java/org/keycloak/keys/Attributes.java:85 Algorithm.RS256, Algorithm.RS384, Algorithm.RS512, Algorithm.PS256, Algorithm.PS384, Algorithm.PS512);
  11. services/src/main/java/org/keycloak/keys/GeneratedRsaKeyProviderFactory.java:75 || algorithm.equals(Algorithm.PS256)
  12. services/src/main/java/org/keycloak/keys/ImportedRsaKeyProviderFactory.java:68 || algorithm.equals(Algorithm.PS256)
  13. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:107 case Algorithm.PS256, Algorithm.PS384, Algorithm.PS512, Algorithm.RS256, Algorithm.RS384, Algorithm.RS512 ->
  14. services/src/main/java/org/keycloak/protocol/oidc/grants/ciba/clientpolicy/executor/SecureCibaAuthenticationRequestSigningAlgorithmExecutorFactory.java:45 ProviderConfigProperty.LIST_TYPE, Algorithm.PS256, new LinkedList<>(FapiConstant.ALLOWED_ALGORITHMS).toArray(new String[] {}));
  15. services/src/main/java/org/keycloak/protocol/oidc/grants/ciba/clientpolicy/executor/SecureCibaAuthenticationRequestSigningAlgorithmExecutor.java:54 private static final String DEFAULT_ALGORITHM_VALUE = Algorithm.PS256;
  16. services/src/main/java/org/keycloak/protocol/oidc/grants/ciba/clientpolicy/executor/SecureCibaAuthenticationRequestSigningAlgorithmExecutor.java:68 if (config.getDefaultAlgorithm() == null || !isSecureAlgorithm(config.getDefaultAlgorithm())) config.setDefaultAlgorithm(DEFAULT_ALGORITHM_VALUE);
  17. services/src/main/java/org/keycloak/protocol/oidc/grants/ciba/clientpolicy/executor/SecureCibaAuthenticationRequestSigningAlgorithmExecutor.java:88 logger.tracev("defaultAlgorithm = {0}, fall back to {1}.", defaultAlgorithm, DEFAULT_ALGORITHM_VALUE);
  18. services/src/main/java/org/keycloak/protocol/oidc/grants/ciba/clientpolicy/executor/SecureCibaAuthenticationRequestSigningAlgorithmExecutor.java:89 this.defaultAlgorithm = DEFAULT_ALGORITHM_VALUE;
  19. services/src/main/java/org/keycloak/protocol/oidc/grants/ciba/clientpolicy/executor/SecureCibaAuthenticationRequestSigningAlgorithmExecutor.java:122 conf.setDefaultAlgorithm(DEFAULT_ALGORITHM_VALUE);
  20. services/src/main/java/org/keycloak/services/clientpolicy/executor/FapiConstant.java:31 Algorithm.PS256,
  21. services/src/main/java/org/keycloak/services/clientpolicy/executor/SecureSigningAlgorithmExecutorFactory.java:42 ProviderConfigProperty.LIST_TYPE, Algorithm.PS256, new LinkedList<>(FapiConstant.ALLOWED_ALGORITHMS).toArray(new String[] {}));
  22. services/src/main/java/org/keycloak/services/clientpolicy/executor/SecureSigningAlgorithmExecutor.java:61 private static final String DEFAULT_ALGORITHM_VALUE = Algorithm.PS256;
  23. services/src/main/java/org/keycloak/services/clientpolicy/executor/SecureSigningAlgorithmExecutor.java:75 if (config.getDefaultAlgorithm() == null || !isSecureAlgorithm(config.getDefaultAlgorithm())) config.setDefaultAlgorithm(DEFAULT_ALGORITHM_VALUE);
  24. services/src/main/java/org/keycloak/services/clientpolicy/executor/SecureSigningAlgorithmExecutor.java:95 logger.tracev("defaultAlgorithm = {0}, fall back to {1}.", defaultAlgorithm, DEFAULT_ALGORITHM_VALUE);
  25. services/src/main/java/org/keycloak/services/clientpolicy/executor/SecureSigningAlgorithmExecutor.java:96 this.defaultAlgorithm = DEFAULT_ALGORITHM_VALUE;
  26. services/src/main/java/org/keycloak/services/clientpolicy/executor/SecureSigningAlgorithmExecutor.java:129 conf.setDefaultAlgorithm(DEFAULT_ALGORITHM_VALUE);
  27. services/src/main/resources/keycloak-default-client-profiles.json:89 "default-algorithm": "PS256"
  28. services/src/main/resources/keycloak-default-client-profiles.json:125 "default-algorithm": "PS256"
  29. services/src/main/resources/keycloak-default-client-profiles.json:165 "default-algorithm": "PS256"
  30. services/src/main/resources/keycloak-default-client-profiles.json:239 "default-algorithm": "PS256"
  31. services/src/main/resources/keycloak-default-client-profiles.json:415 "default-algorithm": "PS256"
  32. services/src/main/resources/keycloak-default-client-profiles.json:491 "default-algorithm": "PS256"
jose.algorithm · CWE-327
ECDSA-P384 Quantum-vulnerable 18 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:36 String ES384 = "ES384";
  2. core/src/main/java/org/keycloak/crypto/ECDSAAlgorithm.java:29 ES384(96),
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:63 case Algorithm.ES384:
  4. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:105 case Algorithm.ES384:
  5. core/src/main/java/org/keycloak/crypto/KeyWrapper.java:104 return Algorithm.ES384;
  6. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:41 ES384(AlgorithmType.ECDSA, null),
  7. js/apps/admin-ui/src/authentication/policies/WebauthnPolicy.tsx:40 "ES384",
  8. services/src/main/java/org/keycloak/authentication/requiredactions/WebAuthnRegister.java:426 case Algorithm.ES384 :
  9. services/src/main/java/org/keycloak/crypto/ES384ClientSignatureVerifierProviderFactory.java:23 public static final String ID = Algorithm.ES384;
  10. services/src/main/java/org/keycloak/crypto/ES384ClientSignatureVerifierProviderFactory.java:32 return new ECDSAClientSignatureVerifierProvider(session, Algorithm.ES384);
  11. services/src/main/java/org/keycloak/crypto/ES384SignatureProviderFactory.java:25 public static final String ID = Algorithm.ES384;
  12. services/src/main/java/org/keycloak/crypto/ES384SignatureProviderFactory.java:34 return new ECDSASignatureProvider(session, Algorithm.ES384);
  13. services/src/main/java/org/keycloak/keys/GeneratedEcdsaKeyProviderFactory.java:87 return (algorithm.equals(Algorithm.ES256) || algorithm.equals(Algorithm.ES384)
  14. services/src/main/java/org/keycloak/keys/GeneratedEcdsaKeyProviderFactory.java:126 return Algorithm.ES384;
  15. services/src/main/java/org/keycloak/keys/GeneratedEcdsaKeyProviderFactory.java:138 case Algorithm.ES384 :
  16. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProviderFactory.java:194 List.of(Algorithm.ES256, Algorithm.ES384, Algorithm.ES512),
  17. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:111 case Algorithm.ES256, Algorithm.ES384, Algorithm.ES512 ->
  18. services/src/main/java/org/keycloak/services/clientpolicy/executor/FapiConstant.java:35 Algorithm.ES384,
jose.algorithm · CWE-327
ECDSA-P521 Quantum-vulnerable 18 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:37 String ES512 = "ES512";
  2. core/src/main/java/org/keycloak/crypto/ECDSAAlgorithm.java:30 ES512(132);
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:65 case Algorithm.ES512:
  4. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:107 case Algorithm.ES512:
  5. core/src/main/java/org/keycloak/crypto/KeyWrapper.java:108 return Algorithm.ES512;
  6. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:42 ES512(AlgorithmType.ECDSA, null),
  7. js/apps/admin-ui/src/authentication/policies/WebauthnPolicy.tsx:41 "ES512",
  8. services/src/main/java/org/keycloak/authentication/requiredactions/WebAuthnRegister.java:432 case Algorithm.ES512 :
  9. services/src/main/java/org/keycloak/crypto/ES512ClientSignatureVerifierProviderFactory.java:23 public static final String ID = Algorithm.ES512;
  10. services/src/main/java/org/keycloak/crypto/ES512ClientSignatureVerifierProviderFactory.java:32 return new ECDSAClientSignatureVerifierProvider(session, Algorithm.ES512);
  11. services/src/main/java/org/keycloak/crypto/ES512SignatureProviderFactory.java:25 public static final String ID = Algorithm.ES512;
  12. services/src/main/java/org/keycloak/crypto/ES512SignatureProviderFactory.java:34 return new ECDSASignatureProvider(session, Algorithm.ES512);
  13. services/src/main/java/org/keycloak/keys/GeneratedEcdsaKeyProviderFactory.java:88 || algorithm.equals(Algorithm.ES512));
  14. services/src/main/java/org/keycloak/keys/GeneratedEcdsaKeyProviderFactory.java:128 return Algorithm.ES512;
  15. services/src/main/java/org/keycloak/keys/GeneratedEcdsaKeyProviderFactory.java:140 case Algorithm.ES512 :
  16. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProviderFactory.java:194 List.of(Algorithm.ES256, Algorithm.ES384, Algorithm.ES512),
  17. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:111 case Algorithm.ES256, Algorithm.ES384, Algorithm.ES512 ->
  18. services/src/main/java/org/keycloak/services/clientpolicy/executor/FapiConstant.java:36 Algorithm.ES512
jose.algorithm · CWE-327
RSASSA-PKCS1-SHA256 Quantum-vulnerable 16 places See details

Classical signature algorithm through the JCA

`Signature.getInstance()` with a classical algorithm. The digest and the key algorithm are split out of the JCA name, so `SHA1withRSA` reports both the broken digest and the quantum-vulnerable key.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer. The v1.5 signature scheme of RFC 8017 section 8.2 has no classical break of its own; RSA-PSS is preferred for new work, but the quantum exposure is the same for both.

What to do. ML-DSA-65 (FIPS 204). Where the verifier cannot be changed, sign twice and publish both signatures.

  1. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:21 public static final String RS256 = "SHA256withRSA";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:50 return RS256;
  3. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:39 return "SHA256withRSA";
  4. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:57 return Signature.getInstance(getJavaAlgorithm(alg));
  5. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:68 return signature.sign();
  6. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:89 return verifier.verify(input.getSignature());
  7. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:143 sigGen = new JcaContentSignerBuilder("SHA256WithRSAEncryption").setProvider(BouncyIntegration.PROVIDER)
  8. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:200 signerBuilder = new JcaContentSignerBuilder("SHA256WithRSAEncryption")
  9. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:316 ContentSigner contentSigner = new JcaContentSignerBuilder("SHA256withRSA")
  10. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronCertificateUtilsProvider.java:143 cbuilder.setSignatureAlgorithmName("SHA256withRSA");
  11. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronCertificateUtilsProvider.java:205 cbuilder.setSignatureAlgorithmName("SHA256withRSA");
  12. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronCertificateUtilsProvider.java:343 .setSignatureAlgorithmName("SHA256withRSA");
  13. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:143 sigGen = new JcaContentSignerBuilder("SHA256WithRSAEncryption").setProvider(BouncyIntegration.PROVIDER)
  14. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:203 signerBuilder = new JcaContentSignerBuilder("SHA256WithRSAEncryption")
  15. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:319 ContentSigner contentSigner = new JcaContentSignerBuilder("SHA256withRSA")
  16. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:30 RSA_SHA256("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", "http://www.w3.org/2001/04/xmlenc#sha256", "SHA256withRSA"),
java.signature · CWE-327
ECDSA Quantum-vulnerable 15 places See details

Classical signature algorithm through the JCA

`Signature.getInstance()` with a classical algorithm. The digest and the key algorithm are split out of the JCA name, so `SHA1withRSA` reports both the broken digest and the quantum-vulnerable key.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. ML-DSA-65 (FIPS 204). Where the verifier cannot be changed, sign twice and publish both signatures.

  1. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:27 public static final String ES256 = "SHA256withECDSA";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:28 public static final String ES384 = "SHA384withECDSA";
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:29 public static final String ES512 = "SHA512withECDSA";
  4. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:62 return ES256;
  5. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:64 return ES384;
  6. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:66 return ES512;
  7. core/src/main/java/org/keycloak/jose/jws/crypto/ECDSAProvider.java:40 return "SHA256withECDSA";
  8. core/src/main/java/org/keycloak/jose/jws/crypto/ECDSAProvider.java:42 return "SHA384withECDSA";
  9. core/src/main/java/org/keycloak/jose/jws/crypto/ECDSAProvider.java:44 return "SHA512withECDSA";
  10. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:139 sigGen = new JcaContentSignerBuilder("SHA256WithECDSA").setProvider(BouncyIntegration.PROVIDER)
  11. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:206 signerBuilder = new JcaContentSignerBuilder("SHA256WithECDSA")
  12. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronCertificateUtilsProvider.java:140 cbuilder.setSignatureAlgorithmName("SHA256withECDSA");
  13. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronCertificateUtilsProvider.java:202 cbuilder.setSignatureAlgorithmName("SHA256withECDSA");
  14. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:139 sigGen = new JcaContentSignerBuilder("SHA256WithECDSA").setProvider(BouncyIntegration.PROVIDER)
  15. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:208 signerBuilder = new JcaContentSignerBuilder("SHA256WithECDSA")
java.signature · CWE-327
RSA-OAEP Quantum-vulnerable Recorded traffic 14 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. common/src/main/java/org/keycloak/common/crypto/CryptoConstants.java:11 public static final String RSA_OAEP = "RSA-OAEP";
  2. core/src/main/java/org/keycloak/crypto/Algorithm.java:47 String RSA_OAEP = CryptoConstants.RSA_OAEP;
  3. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:30 public static final String RSA_OAEP = CryptoConstants.RSA_OAEP;
  4. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:96 providers.put(CryptoConstants.RSA_OAEP, new RSAWrapperAlgorithmProvider(new FIPSRsaKeyEncryptionJWEAlgorithmProvider(FipsRSA.WRAP_OAEP)));
  5. js/apps/admin-ui/src/identity-providers/add/DescriptorSettings.tsx:263 defaultValue: "RSA-OAEP",
  6. js/apps/admin-ui/src/identity-providers/add/DescriptorSettings.tsx:265 options={["RSA-OAEP", "RSA1_5"]}
  7. server-spi-private/src/main/java/org/keycloak/models/utils/DefaultKeyProviders.java:74 config.putSingle("algorithm", Algorithm.RSA_OAEP);
  8. services/src/main/java/org/keycloak/crypto/RsaCekManagementProvider.java:37 if (JWEConstants.RSA1_5.equals(jweAlgorithmName) || JWEConstants.RSA_OAEP.equals(jweAlgorithmName) ||
  9. services/src/main/java/org/keycloak/crypto/RsaesOaepCekManagementProviderFactory.java:25 public static final String ID = JWEConstants.RSA_OAEP;
  10. services/src/main/java/org/keycloak/keys/AbstractRsaKeyProvider.java:56 String defaultAlgorithmKey = KeyUse.ENC.name().equals(model.get(Attributes.KEY_USE)) ? JWEConstants.RSA_OAEP : Algorithm.RS256;
  11. services/src/main/java/org/keycloak/keys/Attributes.java:92 JWEConstants.RSA_OAEP,
  12. services/src/main/java/org/keycloak/keys/GeneratedRsaEncKeyProviderFactory.java:72 || algorithm.equals(Algorithm.RSA_OAEP)
  13. services/src/main/java/org/keycloak/keys/ImportedRsaEncKeyProviderFactory.java:65 || algorithm.equals(Algorithm.RSA_OAEP)
  14. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:82 String defaultAlgorithmKey = KeyUse.ENC.name().equalsIgnoreCase(model.get(Attributes.KEY_USE)) ? JWEConstants.RSA_OAEP : Algorithm.RS256;
jose.algorithm · CWE-327
RSASSA-PKCS1-SHA384 Quantum-vulnerable 14 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer. The v1.5 signature scheme of RFC 8017 section 8.2 has no classical break of its own; RSA-PSS is preferred for new work, but the quantum exposure is the same for both.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:28 String RS384 = "RS384";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:51 case Algorithm.RS384:
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:93 case Algorithm.RS384:
  4. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:211 return sign(Algorithm.RS384, privateKey);
  5. js/apps/admin-ui/src/authentication/policies/WebauthnPolicy.tsx:43 "RS384",
  6. services/src/main/java/org/keycloak/authentication/requiredactions/WebAuthnRegister.java:429 case Algorithm.RS384 :
  7. services/src/main/java/org/keycloak/crypto/RS384ClientSignatureVerifierProviderFactory.java:23 public static final String ID = Algorithm.RS384;
  8. services/src/main/java/org/keycloak/crypto/RS384ClientSignatureVerifierProviderFactory.java:32 return new AsymmetricClientSignatureVerifierProvider(session, Algorithm.RS384);
  9. services/src/main/java/org/keycloak/crypto/RS384SignatureProviderFactory.java:25 public static final String ID = Algorithm.RS384;
  10. services/src/main/java/org/keycloak/crypto/RS384SignatureProviderFactory.java:34 return new AsymmetricSignatureProvider(session, Algorithm.RS384);
  11. services/src/main/java/org/keycloak/keys/Attributes.java:85 Algorithm.RS256, Algorithm.RS384, Algorithm.RS512, Algorithm.PS256, Algorithm.PS384, Algorithm.PS512);
  12. services/src/main/java/org/keycloak/keys/GeneratedRsaKeyProviderFactory.java:76 || algorithm.equals(Algorithm.RS384)
  13. services/src/main/java/org/keycloak/keys/ImportedRsaKeyProviderFactory.java:69 || algorithm.equals(Algorithm.RS384)
  14. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:107 case Algorithm.PS256, Algorithm.PS384, Algorithm.PS512, Algorithm.RS256, Algorithm.RS384, Algorithm.RS512 ->
jose.algorithm · CWE-327
RSASSA-PKCS1-SHA512 Quantum-vulnerable 14 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer. The v1.5 signature scheme of RFC 8017 section 8.2 has no classical break of its own; RSA-PSS is preferred for new work, but the quantum exposure is the same for both.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:29 String RS512 = "RS512";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:53 case Algorithm.RS512:
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:95 case Algorithm.RS512:
  4. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:216 return sign(Algorithm.RS512, privateKey);
  5. js/apps/admin-ui/src/authentication/policies/WebauthnPolicy.tsx:44 "RS512",
  6. services/src/main/java/org/keycloak/authentication/requiredactions/WebAuthnRegister.java:435 case Algorithm.RS512 :
  7. services/src/main/java/org/keycloak/crypto/RS512ClientSignatureVerifierProviderFactory.java:23 public static final String ID = Algorithm.RS512;
  8. services/src/main/java/org/keycloak/crypto/RS512ClientSignatureVerifierProviderFactory.java:32 return new AsymmetricClientSignatureVerifierProvider(session, Algorithm.RS512);
  9. services/src/main/java/org/keycloak/crypto/RS512SignatureProviderFactory.java:25 public static final String ID = Algorithm.RS512;
  10. services/src/main/java/org/keycloak/crypto/RS512SignatureProviderFactory.java:34 return new AsymmetricSignatureProvider(session, Algorithm.RS512);
  11. services/src/main/java/org/keycloak/keys/Attributes.java:85 Algorithm.RS256, Algorithm.RS384, Algorithm.RS512, Algorithm.PS256, Algorithm.PS384, Algorithm.PS512);
  12. services/src/main/java/org/keycloak/keys/GeneratedRsaKeyProviderFactory.java:78 || algorithm.equals(Algorithm.RS512)
  13. services/src/main/java/org/keycloak/keys/ImportedRsaKeyProviderFactory.java:71 || algorithm.equals(Algorithm.RS512)
  14. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:107 case Algorithm.PS256, Algorithm.PS384, Algorithm.PS512, Algorithm.RS256, Algorithm.RS384, Algorithm.RS512 ->
jose.algorithm · CWE-327
RSASSA-PSS-SHA384 Quantum-vulnerable 14 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:31 String PS384 = "PS384";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:69 case Algorithm.PS384:
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:111 case Algorithm.PS384:
  4. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:38 PS384(AlgorithmType.RSA, null),
  5. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:183 case JavaAlgorithm.PS256, JavaAlgorithm.PS384, JavaAlgorithm.PS512:
  6. services/src/main/java/org/keycloak/crypto/PS384ClientSignatureVerifierProviderFactory.java:23 public static final String ID = Algorithm.PS384;
  7. services/src/main/java/org/keycloak/crypto/PS384ClientSignatureVerifierProviderFactory.java:32 return new AsymmetricClientSignatureVerifierProvider(session, Algorithm.PS384);
  8. services/src/main/java/org/keycloak/crypto/PS384SignatureProviderFactory.java:25 public static final String ID = Algorithm.PS384;
  9. services/src/main/java/org/keycloak/crypto/PS384SignatureProviderFactory.java:34 return new AsymmetricSignatureProvider(session, Algorithm.PS384);
  10. services/src/main/java/org/keycloak/keys/Attributes.java:85 Algorithm.RS256, Algorithm.RS384, Algorithm.RS512, Algorithm.PS256, Algorithm.PS384, Algorithm.PS512);
  11. services/src/main/java/org/keycloak/keys/GeneratedRsaKeyProviderFactory.java:77 || algorithm.equals(Algorithm.PS384)
  12. services/src/main/java/org/keycloak/keys/ImportedRsaKeyProviderFactory.java:70 || algorithm.equals(Algorithm.PS384)
  13. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:107 case Algorithm.PS256, Algorithm.PS384, Algorithm.PS512, Algorithm.RS256, Algorithm.RS384, Algorithm.RS512 ->
  14. services/src/main/java/org/keycloak/services/clientpolicy/executor/FapiConstant.java:32 Algorithm.PS384,
jose.algorithm · CWE-327
RSASSA-PSS-SHA512 Quantum-vulnerable 14 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:32 String PS512 = "PS512";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:71 case Algorithm.PS512:
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:113 case Algorithm.PS512:
  4. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:39 PS512(AlgorithmType.RSA, null),
  5. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:183 case JavaAlgorithm.PS256, JavaAlgorithm.PS384, JavaAlgorithm.PS512:
  6. services/src/main/java/org/keycloak/crypto/PS512ClientSignatureVerifierProviderFactory.java:23 public static final String ID = Algorithm.PS512;
  7. services/src/main/java/org/keycloak/crypto/PS512ClientSignatureVerifierProviderFactory.java:32 return new AsymmetricClientSignatureVerifierProvider(session, Algorithm.PS512);
  8. services/src/main/java/org/keycloak/crypto/PS512SignatureProviderFactory.java:25 public static final String ID = Algorithm.PS512;
  9. services/src/main/java/org/keycloak/crypto/PS512SignatureProviderFactory.java:34 return new AsymmetricSignatureProvider(session, Algorithm.PS512);
  10. services/src/main/java/org/keycloak/keys/Attributes.java:85 Algorithm.RS256, Algorithm.RS384, Algorithm.RS512, Algorithm.PS256, Algorithm.PS384, Algorithm.PS512);
  11. services/src/main/java/org/keycloak/keys/GeneratedRsaKeyProviderFactory.java:79 || algorithm.equals(Algorithm.PS512);
  12. services/src/main/java/org/keycloak/keys/ImportedRsaKeyProviderFactory.java:72 || algorithm.equals(Algorithm.PS512);
  13. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:107 case Algorithm.PS256, Algorithm.PS384, Algorithm.PS512, Algorithm.RS256, Algorithm.RS384, Algorithm.RS512 ->
  14. services/src/main/java/org/keycloak/services/clientpolicy/executor/FapiConstant.java:33 Algorithm.PS512,
jose.algorithm · CWE-327
RSA-OAEP Quantum-vulnerable 11 places See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:11 const ALGORITHM_RSA_OAEP = "http://www.w3.org/2009/xmlenc11#rsa-oaep";
  2. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:13 "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p";
  3. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:23 if (keyEncryptionAlgorithm !== ALGORITHM_RSA_OAEP) {
  4. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:30 if (keyEncryptionAlgorithm !== ALGORITHM_RSA_OAEP_MGF1P) {
  5. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:93 key: ALGORITHM_RSA_OAEP,
  6. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:97 key: ALGORITHM_RSA_OAEP_MGF1P,
  7. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:104 {(keyEncryptionAlgorithm === ALGORITHM_RSA_OAEP ||
  8. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:105 keyEncryptionAlgorithm === ALGORITHM_RSA_OAEP_MGF1P) && (
  9. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:130 {keyEncryptionAlgorithm === ALGORITHM_RSA_OAEP && (
  10. model/jpa/src/main/java/org/keycloak/connections/jpa/updater/liquibase/custom/JpaUpdate26_4_0_SamlEncryptionAttributes.java:37 statements.add(createInsertQueryForAttribute("saml.encryption.keyAlgorithm", "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"));
  11. model/storage-private/src/main/java/org/keycloak/storage/datastore/DefaultExportImportManager.java:589 app.setAttribute("saml.encryption.keyAlgorithm", "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p");
xmldsig.algorithm · CWE-327
RSA-OAEP-SHA256 Quantum-vulnerable Recorded traffic 11 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. common/src/main/java/org/keycloak/common/crypto/CryptoConstants.java:12 public static final String RSA_OAEP_256 = "RSA-OAEP-256";
  2. core/src/main/java/org/keycloak/crypto/Algorithm.java:48 String RSA_OAEP_256 = CryptoConstants.RSA_OAEP_256;
  3. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:31 public static final String RSA_OAEP_256 = CryptoConstants.RSA_OAEP_256;
  4. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:97 providers.put(CryptoConstants.RSA_OAEP_256, new RSAWrapperAlgorithmProvider(new FIPSRsaKeyEncryptionJWEAlgorithmProvider(FipsRSA.WRAP_OAEP.withDigest(FipsSHS.Algorithm.SHA256))));
  5. services/src/main/java/org/keycloak/crypto/RsaCekManagementProvider.java:38 JWEConstants.RSA_OAEP_256.equals(jweAlgorithmName)) {
  6. services/src/main/java/org/keycloak/crypto/RsaesOaep256CekManagementProviderFactory.java:25 public static final String ID = JWEConstants.RSA_OAEP_256;
  7. services/src/main/java/org/keycloak/keys/Attributes.java:93 JWEConstants.RSA1_5, JWEConstants.RSA_OAEP, JWEConstants.RSA_OAEP_256);
  8. services/src/main/java/org/keycloak/keys/GeneratedRsaEncKeyProviderFactory.java:73 || algorithm.equals(Algorithm.RSA_OAEP_256);
  9. services/src/main/java/org/keycloak/keys/ImportedRsaEncKeyProviderFactory.java:66 || algorithm.equals(Algorithm.RSA_OAEP_256);
  10. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:109 case Algorithm.RSA_OAEP, Algorithm.RSA1_5, Algorithm.RSA_OAEP_256 ->
  11. services/src/main/java/org/keycloak/protocol/oid4vc/issuance/OID4VCIssuerWellKnownProvider.java:428 supportedEncryptionAlgorithms = List.of(JWEConstants.RSA_OAEP, JWEConstants.RSA_OAEP_256);
jose.algorithm · CWE-327
Ed448 Quantum-vulnerable 10 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:43 String Ed448 = "Ed448";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:34 public static final String Ed448 = "Ed448";
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:120 case Algorithm.Ed448:
  4. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:142 case Algorithm.Ed448:
  5. core/src/main/java/org/keycloak/jose/jwk/EdECUtilsImpl.java:80 } else if (Algorithm.Ed448.equals(crv)) {
  6. core/src/main/java/org/keycloak/jose/jwk/EdECUtilsImpl.java:123 } else if (Algorithm.Ed448.equals(eddsaPublicKey.getParams().getName())) {
  7. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:116 if (org.keycloak.crypto.Algorithm.Ed25519.equals(sigAlgName) || org.keycloak.crypto.Algorithm.Ed448.equals(sigAlgName)) {
  8. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:211 case JavaAlgorithm.Ed448: {
  9. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:213 case JavaAlgorithm.Ed448: {
  10. services/src/main/java/org/keycloak/keys/AbstractEddsaKeyProviderFactory.java:42 String.valueOf(DEFAULT_EDDSA_ELLIPTIC_CURVE), Algorithm.Ed25519, Algorithm.Ed448);
jose.algorithm · CWE-327
TLS Quantum-vulnerable Recorded traffic 10 places See details

TLS used in code

A TLS connection, context or setting made in code: `SSLContexts.createDefault()`, `SSLSocketFactory.getDefault()`, `setEnabledProtocols()`, `setEnabledCipherSuites()`, `startHandshake()`, Go `tls.VersionTLS12` and `tls.Dial()`, Python `ssl.create_default_context()`, Node `tls.connect()`, and version names such as `"TLSv1.2"`. Every TLS key exchange in general use is classical, so recorded traffic is exposed.

This code opens or configures an encrypted connection. Its key exchange is the part a future quantum computer breaks, which exposes traffic recorded today.

What to do. TLS 1.3 everywhere, then a hybrid group such as X25519MLKEM768 as the platform offers it.

  1. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/AbstractDelegatingSSLSocket.java:74 delegate.setEnabledCipherSuites(suites);
  2. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/AbstractDelegatingSSLSocket.java:86 delegate.setEnabledProtocols(protocols);
  3. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/AbstractDelegatingSSLSocket.java:106 delegate.startHandshake();
  4. federation/ldap/src/main/java/org/keycloak/storage/ldap/idm/store/ldap/LDAPContextManager.java:161 SSLSocketFactory factory = sslSocketFactory == null ? (SSLSocketFactory) SSLSocketFactory.getDefault() : sslSocketFactory;
  5. integration/client-cli/admin-cli/src/main/java/org/keycloak/client/cli/util/HttpUtil.java:274 SSLContext theContext = SSLContexts.custom()
  6. services/src/main/java/org/keycloak/connections/httpclient/HttpClientBuilder.java:332 return SSLContexts.custom()
  7. services/src/main/java/org/keycloak/truststore/FileTruststoreProvider.java:55 this.sslSocketFactory = (jsseSSLSocketFactory != null) ? jsseSSLSocketFactory : (SSLSocketFactory) javax.net.ssl.SSLSocketFactory.getDefault();
  8. services/src/main/java/org/keycloak/truststore/SSLSocketFactory.java:62 sf = (javax.net.ssl.SSLSocketFactory) javax.net.ssl.SSLSocketFactory.getDefault();
  9. util/embedded-ldap/src/main/java/org/keycloak/util/ldap/TLS13StartTlsHandler.java:100 sslFilter.setEnabledCipherSuites(ciphers.toArray(new String[0]));
  10. util/embedded-ldap/src/main/java/org/keycloak/util/ldap/TLS13StartTlsHandler.java:103 sslFilter.setEnabledProtocols(protocols.toArray(new String[0]));
tls.protocol · CWE-757
TLS Quantum-vulnerable Recorded traffic 8 places See details

TLS context created in code

`SSLContext.getInstance()`. The protocol version is reported; the key exchange it negotiates is classical in every TLS 1.2 and 1.3 cipher suite available today.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Every TLS cipher suite in general use negotiates a classical key exchange, so a recorded session is decryptable once that exchange falls.

What to do. Keep TLS 1.3, and track the hybrid key-exchange groups as they reach the JDK. TLS is where harvest-now-decrypt-later exposure is largest.

java.sslcontext · CWE-757
ECDSA Quantum-vulnerable 7 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

code.named-call
EdDSA Quantum-vulnerable 7 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:43 EdDSA(AlgorithmType.EDDSA, null),
  2. core/src/main/java/org/keycloak/mdoc/MdocDeviceKey.java:126 return new EdDSACOSEKey(keyId, algorithm, null, Curve.ED25519, Base64Url.decode(okp.getX()), null);
  3. services/src/main/java/org/keycloak/crypto/EdDSAClientSignatureVerifierProviderFactory.java:36 return new EdDSAClientSignatureVerifierProvider(session, Algorithm.EdDSA);
  4. services/src/main/java/org/keycloak/crypto/EdDSASignatureProviderFactory.java:37 return new EdDSASignatureProvider(session);
  5. services/src/main/java/org/keycloak/keys/GeneratedEddsaKeyProviderFactory.java:58 return new GeneratedEddsaKeyProvider(session.getContext().getRealm(), model);
  6. services/src/main/java/org/keycloak/keys/GeneratedEddsaKeyProviderFactory.java:124 keyPair = KeyUtils.generateEddsaKeyPair(curveName);
  7. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:116 loadEdDSAKey(keyStore, keyAlias, KeyUse.SIG);
code.named-call
RSA Quantum-vulnerable Recorded traffic 7 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. core/src/main/java/org/keycloak/jose/jwk/JWKParser.java:154 return (RSAPublicJWK.RSA.equals(keyType) || ECPublicJWK.EC.equals(keyType)
  2. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:34 RS256(AlgorithmType.RSA, new RSAProvider()),
  3. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:35 RS384(AlgorithmType.RSA, new RSAProvider()),
  4. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:36 RS512(AlgorithmType.RSA, new RSAProvider()),
  5. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:37 PS256(AlgorithmType.RSA, null),
  6. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:38 PS384(AlgorithmType.RSA, null),
  7. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:39 PS512(AlgorithmType.RSA, null),
code.algorithm-constant
RSASSA-PKCS1-SHA512 Quantum-vulnerable 7 places See details

Classical signature algorithm through the JCA

`Signature.getInstance()` with a classical algorithm. The digest and the key algorithm are split out of the JCA name, so `SHA1withRSA` reports both the broken digest and the quantum-vulnerable key.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer. The v1.5 signature scheme of RFC 8017 section 8.2 has no classical break of its own; RSA-PSS is preferred for new work, but the quantum exposure is the same for both.

What to do. ML-DSA-65 (FIPS 204). Where the verifier cannot be changed, sign twice and publish both signatures.

  1. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:23 public static final String RS512 = "SHA512withRSA";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:54 return RS512;
  3. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:43 return "SHA512withRSA";
  4. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:57 return Signature.getInstance(getJavaAlgorithm(alg));
  5. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:68 return signature.sign();
  6. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:89 return verifier.verify(input.getSignature());
  7. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:32 RSA_SHA512("http://www.w3.org/2001/04/xmldsig-more#rsa-sha512", "http://www.w3.org/2001/04/xmlenc#sha512", "SHA512withRSA"),
java.signature · CWE-327
RSASSA-PSS-SHA256 Quantum-vulnerable 7 places See details

Classical signature algorithm through the JCA

`Signature.getInstance()` with a classical algorithm. The digest and the key algorithm are split out of the JCA name, so `SHA1withRSA` reports both the broken digest and the quantum-vulnerable key.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. ML-DSA-65 (FIPS 204). Where the verifier cannot be changed, sign twice and publish both signatures.

  1. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:30 public static final String PS256 = "SHA256withRSAandMGF1";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:68 return PS256;
  3. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:45 return "SHA256withRSAandMGF1";
  4. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:57 return Signature.getInstance(getJavaAlgorithm(alg));
  5. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:68 return signature.sign();
  6. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:89 return verifier.verify(input.getSignature());
  7. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:31 RSA_SHA256_MGF1("http://www.w3.org/2007/05/xmldsig-more#sha256-rsa-MGF1", "http://www.w3.org/2001/04/xmlenc#sha256", "SHA256withRSAandMGF1"),
java.signature · CWE-327
RSASSA-PSS-SHA512 Quantum-vulnerable 7 places See details

Classical signature algorithm through the JCA

`Signature.getInstance()` with a classical algorithm. The digest and the key algorithm are split out of the JCA name, so `SHA1withRSA` reports both the broken digest and the quantum-vulnerable key.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. ML-DSA-65 (FIPS 204). Where the verifier cannot be changed, sign twice and publish both signatures.

  1. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:32 public static final String PS512 = "SHA512withRSAandMGF1";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:72 return PS512;
  3. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:49 return "SHA512withRSAandMGF1";
  4. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:57 return Signature.getInstance(getJavaAlgorithm(alg));
  5. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:68 return signature.sign();
  6. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:89 return verifier.verify(input.getSignature());
  7. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:33 RSA_SHA512_MGF1("http://www.w3.org/2007/05/xmldsig-more#sha512-rsa-MGF1", "http://www.w3.org/2001/04/xmlenc#sha512", "SHA512withRSAandMGF1"),
java.signature · CWE-327
EC256-bitsecg/secp256r1 Quantum-vulnerable 6 places See details

Key type chosen by a setting

A named curve written as a string - `elliptic_curve="secp256r1"`, `"P-384"` in a list of accepted curves - or an RSA key size in a setting that names RSA (`rsa_key_size=2048`). The curve is reported as ECDSA where the file signs, ECDH where it agrees keys, and EC where it does both or neither.

This setting picks the kind of key the software makes.

What to do. The setting is where the key type changes; keep the list short so a post-quantum option can be added in one place.

  1. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:109 return new ECNamedCurveSpec("prime256v1", spec.getCurve(), spec.getG(), spec.getN());
  2. services/src/main/java/org/keycloak/broker/oid4vp/EphemeralKey.java:41 private static final String CURVE_SEC = "secp256r1";
  3. services/src/main/java/org/keycloak/broker/oid4vp/EphemeralKey.java:44 KeyPair keyPair = KeyUtils.generateEcKeyPair(CURVE_SEC);
  4. services/src/main/java/org/keycloak/keys/AbstractEcKeyProviderFactory.java:29 public static final String DEFAULT_EC_ELLIPTIC_CURVE = "P-256";
  5. services/src/main/java/org/keycloak/keys/AbstractEcKeyProviderFactory.java:52 case "P-256" :
  6. services/src/main/java/org/keycloak/keys/AbstractEcKeyProviderFactory.java:53 ecInSecRep = "secp256r1";
code.curve
ECDH Quantum-vulnerable Recorded traffic 6 places See details

Classical key pair generated through the JCA

`KeyPairGenerator.getInstance()` with a classical algorithm. The concrete family and, where an `initialize()` call is close enough to read, the key size are resolved from the source and reported on the finding.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. Generate the classical key alongside an ML-KEM or ML-DSA key and carry both until relying parties accept the post-quantum one.

java.keypairgenerator · CWE-327
ECDH-P256256-bitsecg/secp256r1 Quantum-vulnerable Recorded traffic 6 places See details

Key type chosen by a setting

A named curve written as a string - `elliptic_curve="secp256r1"`, `"P-384"` in a list of accepted curves - or an RSA key size in a setting that names RSA (`rsa_key_size=2048`). The curve is reported as ECDSA where the file signs, ECDH where it agrees keys, and EC where it does both or neither.

This setting picks the kind of key the software makes.

What to do. The setting is where the key type changes; keep the list short so a post-quantum option can be added in one place.

code.curve
ECDH-P384384-bitsecg/secp384r1 Quantum-vulnerable Recorded traffic 6 places See details

Key type chosen by a setting

A named curve written as a string - `elliptic_curve="secp256r1"`, `"P-384"` in a list of accepted curves - or an RSA key size in a setting that names RSA (`rsa_key_size=2048`). The curve is reported as ECDSA where the file signs, ECDH where it agrees keys, and EC where it does both or neither.

This setting picks the kind of key the software makes.

What to do. The setting is where the key type changes; keep the list short so a post-quantum option can be added in one place.

code.curve
ECDH-P521521-bitsecg/secp521r1 Quantum-vulnerable Recorded traffic 6 places See details

Key type chosen by a setting

A named curve written as a string - `elliptic_curve="secp256r1"`, `"P-384"` in a list of accepted curves - or an RSA key size in a setting that names RSA (`rsa_key_size=2048`). The curve is reported as ECDSA where the file signs, ECDH where it agrees keys, and EC where it does both or neither.

This setting picks the kind of key the software makes.

What to do. The setting is where the key type changes; keep the list short so a post-quantum option can be added in one place.

code.curve
ECDSA-P256256-bitsecg/secp256r1 Quantum-vulnerable 6 places See details

Key type chosen by a setting

A named curve written as a string - `elliptic_curve="secp256r1"`, `"P-384"` in a list of accepted curves - or an RSA key size in a setting that names RSA (`rsa_key_size=2048`). The curve is reported as ECDSA where the file signs, ECDH where it agrees keys, and EC where it does both or neither.

This setting picks the kind of key the software makes.

What to do. The setting is where the key type changes; keep the list short so a post-quantum option can be added in one place.

code.curve
ECDSA-P384384-bitsecg/secp384r1 Quantum-vulnerable 6 places See details

Key type chosen by a setting

A named curve written as a string - `elliptic_curve="secp256r1"`, `"P-384"` in a list of accepted curves - or an RSA key size in a setting that names RSA (`rsa_key_size=2048`). The curve is reported as ECDSA where the file signs, ECDH where it agrees keys, and EC where it does both or neither.

This setting picks the kind of key the software makes.

What to do. The setting is where the key type changes; keep the list short so a post-quantum option can be added in one place.

code.curve
ECDSA-P521521-bitsecg/secp521r1 Quantum-vulnerable 6 places See details

Key type chosen by a setting

A named curve written as a string - `elliptic_curve="secp256r1"`, `"P-384"` in a list of accepted curves - or an RSA key size in a setting that names RSA (`rsa_key_size=2048`). The curve is reported as ECDSA where the file signs, ECDH where it agrees keys, and EC where it does both or neither.

This setting picks the kind of key the software makes.

What to do. The setting is where the key type changes; keep the list short so a post-quantum option can be added in one place.

code.curve
RSA Quantum-vulnerable Recorded traffic 6 places See details

Classical key material handled through the JCA

`KeyFactory.getInstance()` for a classical algorithm. This indicates the code parses or produces keys of that family, which is a migration surface even where it does no cryptography itself.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. Include this code path in the inventory: it has to accept post-quantum key encodings before the keys themselves can change.

  1. adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/PemUtils.java:145 KeyFactory kf = KeyFactory.getInstance("RSA", CryptoConstants.BC_PROVIDER_ID);
  2. adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/PemUtils.java:159 KeyFactory kf = KeyFactory.getInstance("RSA", CryptoConstants.BC_PROVIDER_ID);
  3. common/src/main/java/org/keycloak/common/util/KeyUtils.java:70 KeyFactory keyFactory = KeyFactory.getInstance("RSA");
  4. core/src/main/java/org/keycloak/jose/jwk/JWKParser.java:140 KeyFactory kf = KeyFactory.getInstance("RSA");
  5. saml-core-api/src/main/java/org/keycloak/dom/xmlsec/w3/xmldsig/RSAKeyValueType.java:103 KeyFactory rsaKeyFactory = KeyFactory.getInstance("rsa");
  6. saml-core-api/src/main/java/org/keycloak/dom/xmlsec/w3/xmldsig/RSAKeyValueType.java:122 KeyFactory rsaKeyFactory = KeyFactory.getInstance("rsa");
java.keyfactory · CWE-327
RSA-OAEP Quantum-vulnerable Recorded traffic 6 places See details

Classical public-key cipher through the JCA

`Cipher.getInstance()` with a transformation whose algorithm component is a public-key or legacy symmetric cipher. The transformation string is parsed into algorithm, mode and padding, so `RSA/ECB/PKCS1Padding` is separated from `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. For RSA encryption, move to ML-KEM-768 and keep RSA-OAEP only as the classical half of a hybrid during transition.

java.cipher · CWE-327
RSASSA-PKCS1-SHA384 Quantum-vulnerable 6 places See details

Classical signature algorithm through the JCA

`Signature.getInstance()` with a classical algorithm. The digest and the key algorithm are split out of the JCA name, so `SHA1withRSA` reports both the broken digest and the quantum-vulnerable key.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer. The v1.5 signature scheme of RFC 8017 section 8.2 has no classical break of its own; RSA-PSS is preferred for new work, but the quantum exposure is the same for both.

What to do. ML-DSA-65 (FIPS 204). Where the verifier cannot be changed, sign twice and publish both signatures.

java.signature · CWE-327
RSASSA-PSS-SHA384 Quantum-vulnerable 6 places See details

Classical signature algorithm through the JCA

`Signature.getInstance()` with a classical algorithm. The digest and the key algorithm are split out of the JCA name, so `SHA1withRSA` reports both the broken digest and the quantum-vulnerable key.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. ML-DSA-65 (FIPS 204). Where the verifier cannot be changed, sign twice and publish both signatures.

java.signature · CWE-327
ECDH Quantum-vulnerable Recorded traffic 5 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. services/src/main/java/org/keycloak/crypto/EcdhEsA128KwCekManagementProviderFactory.java:34 return new EcdhEsCekManagementProvider(session, ID);
  2. services/src/main/java/org/keycloak/crypto/EcdhEsA192KwCekManagementProviderFactory.java:34 return new EcdhEsCekManagementProvider(session, ID);
  3. services/src/main/java/org/keycloak/crypto/EcdhEsA256KwCekManagementProviderFactory.java:34 return new EcdhEsCekManagementProvider(session, ID);
  4. services/src/main/java/org/keycloak/crypto/EcdhEsCekManagementProviderFactory.java:34 return new EcdhEsCekManagementProvider(session, ID);
  5. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:90 return new GeneratedEcdhKeyProvider(session.getContext().getRealm(), model);
code.named-call
RSASSA-PKCS1-SHA256 Quantum-vulnerable 5 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/parsers/DeploymentBuilder.java:85 deployment.setSignatureAlgorithm(SignatureAlgorithm.RSA_SHA256);
  2. services/src/main/java/org/keycloak/broker/saml/SAMLIdentityProvider.java:530 return SignatureAlgorithm.RSA_SHA256;
  3. services/src/main/java/org/keycloak/protocol/saml/EntityDescriptorDescriptionConverter.java:189 attributes.put(SamlConfigAttributes.SAML_SIGNATURE_ALGORITHM, SignatureAlgorithm.RSA_SHA256.toString());
  4. services/src/main/java/org/keycloak/protocol/saml/SamlClient.java:64 return SignatureAlgorithm.RSA_SHA256;
  5. services/src/main/java/org/keycloak/protocol/saml/SamlProtocolFactory.java:168 client.setSignatureAlgorithm(SignatureAlgorithm.RSA_SHA256);
code.algorithm-constant
ECDH Quantum-vulnerable Recorded traffic 4 places See details

Classical key agreement through the JCA

`KeyAgreement.getInstance()` with ECDH, DH or XDH. Key agreement is the highest-priority class of finding: traffic recorded today is decrypted once the key exchange is broken.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. ML-KEM-768 (FIPS 203), or a hybrid X25519+ML-KEM-768 construction that keeps the classical guarantee while adding the quantum one.

java.keyagreement · CWE-327
ECDSA Quantum-vulnerable 4 places See details

Classical key material handled through the JCA

`KeyFactory.getInstance()` for a classical algorithm. This indicates the code parses or produces keys of that family, which is a migration surface even where it does no cryptography itself.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. Include this code path in the inventory: it has to accept post-quantum key encodings before the keys themselves can change.

java.keyfactory · CWE-327
RSA-OAEP Quantum-vulnerable Recorded traffic 4 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. saml-core/src/main/java/org/keycloak/saml/processing/core/util/XMLEncryptionUtil.java:77 private static final String RSA_ENCRYPTION_SCHEME = XMLCipher.RSA_OAEP_11;
  2. saml-core/src/main/java/org/keycloak/saml/processing/core/util/XMLEncryptionUtil.java:196 if (XMLCipher.RSA_OAEP_11.equals(keyEncryptionAlgorithm)) {
  3. services/src/main/java/org/keycloak/protocol/saml/SamlProtocolUtils.java:163 XMLCipher.RSA_OAEP_11.equals(samlClient.getClientEncryptingKeyAlgorithm()))) {
  4. services/src/main/java/org/keycloak/protocol/saml/SamlProtocolUtils.java:168 XMLCipher.RSA_OAEP_11.equals(samlClient.getClientEncryptingKeyAlgorithm())) {
code.algorithm-constant
RSASSA-PKCS1-SHA1 Quantum-vulnerable 4 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. saml-core/src/main/java/org/keycloak/saml/BaseSAML2BindingBuilder.java:69 protected SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.RSA_SHA1;
  2. saml-core/src/main/java/org/keycloak/saml/processing/api/saml/v2/sig/SAML2Signature.java:55 private String signatureMethod = SignatureMethod.RSA_SHA1;
  3. saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/SignatureUtil.java:83 xmlSignatureAlgo = JBossSAMLConstants.SIGNATURE_SHA1_WITH_RSA.get();
  4. saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/SignatureUtil.java:214 sig = Signature.getInstance(PicketLinkFederationConstants.RSA_SIGNATURE_ALGORITHM);
code.algorithm-constant
DSA Quantum-vulnerable 3 places See details

Algorithm named in a setting

A setting whose name says it holds an algorithm, given a literal that names one: `withOaepPaddingDigestAlgorithm("SHA-512")`, `signatureAlgorithm = "SHA256withRSA"`, `"digestAlgorithm": "SHA-256"`. The algorithm never reaches a `getInstance()` in this file - it is carried to one somewhere else, often through configuration - so a scan that only reads the factories cannot see it at all.

Something here is configured to use a named algorithm. The code that uses it may be somewhere else entirely, but this is the line that decides which algorithm it is.

What to do. Find what consumes the setting. The migration belongs to that operation; this line is where the choice is actually written down, and usually where it is easiest to change.

config.algorithm-setting · CWE-327
DSA-SHA1 Quantum-vulnerable 3 places See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. saml-core-api/src/main/java/org/keycloak/saml/common/constants/JBossSAMLConstants.java:231 SIGNATURE_SHA1_WITH_DSA("http://www.w3.org/2000/09/xmldsig#dsa-sha1"),
  2. saml-core-api/src/main/java/org/keycloak/saml/common/constants/JBossSAMLURIConstants.java:86 SIGNATURE_DSA_SHA1("http://www.w3.org/2000/09/xmldsig#dsa-sha1"),
  3. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:34 DSA_SHA1("http://www.w3.org/2000/09/xmldsig#dsa-sha1", "http://www.w3.org/2000/09/xmldsig#sha1", "SHA1withDSA")
xmldsig.algorithm · CWE-327
ECDH Quantum-vulnerable Recorded traffic 3 places See details

Classical key material handled through the JCA

`KeyFactory.getInstance()` for a classical algorithm. This indicates the code parses or produces keys of that family, which is a migration surface even where it does no cryptography itself.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. Include this code path in the inventory: it has to accept post-quantum key encodings before the keys themselves can change.

java.keyfactory · CWE-327
ECDSA-P256 Quantum-vulnerable 3 places See details

COSE algorithm identifier

A COSE algorithm named as an identifier or as its IANA registry number - `COSEAlgorithmIdentifier.ES256`, or `alg: -7` in a WebAuthn `pubKeyCredParams`. The names match JOSE's; the numbers are the registry's.

This is the list of signature algorithms a security key or a passkey is allowed to use. Every one available today is broken by a quantum computer, so the value of writing it down now is knowing where to look later.

What to do. No post-quantum COSE algorithm is registered for WebAuthn yet. Record the exposure and keep the list short, so there is less to change when one is.

  1. core/src/main/java/org/keycloak/mdoc/MdocAlgorithm.java:39 ES256(Algorithm.ES256, COSEAlgorithmIdentifier.ES256),
  2. services/src/main/java/org/keycloak/authentication/requiredactions/WebAuthnRegister.java:421 algs.add(COSEAlgorithmIdentifier.ES256.getValue());
  3. themes/src/main/resources/theme/base/login/resources/js/webauthnRegister.js:85 pubKeyCredParams.push({type: "public-key", alg: -7});
cose.algorithm
RSA-OAEP-SHA1 Quantum-vulnerable Recorded traffic 3 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. saml-core/src/main/java/org/keycloak/saml/processing/core/util/XMLEncryptionUtil.java:186 if ((XMLCipher.RSA_OAEP.equals(keyEncryptionAlgorithm) || XMLCipher.RSA_OAEP_11.equals(keyEncryptionAlgorithm))) {
  2. services/src/main/java/org/keycloak/protocol/saml/SAMLEncryptionAlgorithms.java:33 RSA_OAEP(Algorithm.RSA_OAEP, XMLCipher.RSA_OAEP, XMLCipher.RSA_OAEP_11),
  3. services/src/main/java/org/keycloak/protocol/saml/SamlProtocolUtils.java:162 (XMLCipher.RSA_OAEP.equals(samlClient.getClientEncryptingKeyAlgorithm()) ||
code.algorithm-constant
RSASSA-PKCS1-SHA1 Quantum-vulnerable 3 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer. The v1.5 signature scheme of RFC 8017 section 8.2 has no classical break of its own; RSA-PSS is preferred for new work, but the quantum exposure is the same for both.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

jose.algorithm · CWE-327
RSASSA-PKCS1-SHA1 Quantum-vulnerable 3 places See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. saml-core-api/src/main/java/org/keycloak/saml/common/constants/JBossSAMLConstants.java:232 SIGNATURE_SHA1_WITH_RSA("http://www.w3.org/2000/09/xmldsig#rsa-sha1"),
  2. saml-core-api/src/main/java/org/keycloak/saml/common/constants/JBossSAMLURIConstants.java:87 SIGNATURE_RSA_SHA1("http://www.w3.org/2000/09/xmldsig#rsa-sha1"),
  3. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:29 RSA_SHA1("http://www.w3.org/2000/09/xmldsig#rsa-sha1", "http://www.w3.org/2000/09/xmldsig#sha1", "SHA1withRSA"),
xmldsig.algorithm · CWE-327
RSASSA-PKCS1-SHA1 Quantum-vulnerable 3 places See details

Classical signature algorithm through the JCA

`Signature.getInstance()` with a classical algorithm. The digest and the key algorithm are split out of the JCA name, so `SHA1withRSA` reports both the broken digest and the quantum-vulnerable key.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer. The v1.5 signature scheme of RFC 8017 section 8.2 has no classical break of its own; RSA-PSS is preferred for new work, but the quantum exposure is the same for both.

What to do. ML-DSA-65 (FIPS 204). Where the verifier cannot be changed, sign twice and publish both signatures.

  1. saml-core/src/main/java/org/keycloak/saml/processing/core/constants/PicketLinkFederationConstants.java:28 String RSA_SIGNATURE_ALGORITHM = "SHA1withRSA";
  2. saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/SignatureUtil.java:214 sig = Signature.getInstance(PicketLinkFederationConstants.RSA_SIGNATURE_ALGORITHM);
  3. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:29 RSA_SHA1("http://www.w3.org/2000/09/xmldsig#rsa-sha1", "http://www.w3.org/2000/09/xmldsig#sha1", "SHA1withRSA"),
java.signature · CWE-327
DSA Quantum-vulnerable 2 places See details

Classical key material handled through the JCA

`KeyFactory.getInstance()` for a classical algorithm. This indicates the code parses or produces keys of that family, which is a migration surface even where it does no cryptography itself.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. Include this code path in the inventory: it has to accept post-quantum key encodings before the keys themselves can change.

  1. saml-core-api/src/main/java/org/keycloak/dom/xmlsec/w3/xmldsig/DSAKeyValueType.java:211 KeyFactory dsaKeyFactory = KeyFactory.getInstance("dsa");
  2. saml-core-api/src/main/java/org/keycloak/dom/xmlsec/w3/xmldsig/DSAKeyValueType.java:234 KeyFactory dsaKeyFactory = KeyFactory.getInstance("dsa");
java.keyfactory · CWE-327
DSA Quantum-vulnerable 2 places See details

Classical signature algorithm through the JCA

`Signature.getInstance()` with a classical algorithm. The digest and the key algorithm are split out of the JCA name, so `SHA1withRSA` reports both the broken digest and the quantum-vulnerable key.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. ML-DSA-65 (FIPS 204). Where the verifier cannot be changed, sign twice and publish both signatures.

  1. saml-core/src/main/java/org/keycloak/saml/processing/core/constants/PicketLinkFederationConstants.java:27 String DSA_SIGNATURE_ALGORITHM = "SHA1withDSA";
  2. saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/SignatureUtil.java:212 sig = Signature.getInstance(PicketLinkFederationConstants.DSA_SIGNATURE_ALGORITHM);
java.signature · CWE-327
DSA Quantum-vulnerable 2 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. saml-core/src/main/java/org/keycloak/saml/processing/core/parsers/saml/xmldsig/DsaKeyValueParser.java:29 public static final DsaKeyValueParser INSTANCE = new DsaKeyValueParser();
  2. saml-core/src/main/java/org/keycloak/saml/processing/core/parsers/saml/xmldsig/KeyInfoParser.java:62 keyValue = DsaKeyValueParser.getInstance().parse(xmlEventReader);
code.named-call
EC Quantum-vulnerable 2 places See details

Classical key pair generated through the JCA

`KeyPairGenerator.getInstance()` with a classical algorithm. The concrete family and, where an `initialize()` call is close enough to read, the key size are resolved from the source and reported on the finding.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. An elliptic-curve key pair. The source does not say whether it signs or agrees a shared secret, and the curve alone cannot: the same curve serves both.

What to do. Generate the classical key alongside an ML-KEM or ML-DSA key and carry both until relying parties accept the post-quantum one.

  1. common/src/main/java/org/keycloak/common/util/KeyUtils.java:88 KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC");
  2. common/src/main/java/org/keycloak/common/util/KeyUtils.java:92 return keyGen.generateKeyPair();
java.keypairgenerator · CWE-327
EC384-bitsecg/secp384r1 Quantum-vulnerable 2 places See details

Key type chosen by a setting

A named curve written as a string - `elliptic_curve="secp256r1"`, `"P-384"` in a list of accepted curves - or an RSA key size in a setting that names RSA (`rsa_key_size=2048`). The curve is reported as ECDSA where the file signs, ECDH where it agrees keys, and EC where it does both or neither.

This setting picks the kind of key the software makes.

What to do. The setting is where the key type changes; keep the list short so a post-quantum option can be added in one place.

code.curve
EC521-bitsecg/secp521r1 Quantum-vulnerable 2 places See details

Key type chosen by a setting

A named curve written as a string - `elliptic_curve="secp256r1"`, `"P-384"` in a list of accepted curves - or an RSA key size in a setting that names RSA (`rsa_key_size=2048`). The curve is reported as ECDSA where the file signs, ECDH where it agrees keys, and EC where it does both or neither.

This setting picks the kind of key the software makes.

What to do. The setting is where the key type changes; keep the list short so a post-quantum option can be added in one place.

code.curve
ECDH Quantum-vulnerable Recorded traffic 2 places See details

Elliptic-curve cryptography through BouncyCastle

A BouncyCastle elliptic-curve class. `ECDHBasicAgreement` in particular is key establishment and carries harvest-now-decrypt-later exposure.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. ML-DSA-65 for signatures, ML-KEM-768 for key establishment.

  1. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:195 ECNamedCurveParameterSpec spec = ECNamedCurveTable.getParameterSpec(name);
  2. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:200 X9ECParameters ecParams = NISTNamedCurves.getByName(crv);
java.bouncycastle.ec · CWE-327
ECDSA-P384 Quantum-vulnerable 2 places See details

COSE algorithm identifier

A COSE algorithm named as an identifier or as its IANA registry number - `COSEAlgorithmIdentifier.ES256`, or `alg: -7` in a WebAuthn `pubKeyCredParams`. The names match JOSE's; the numbers are the registry's.

This is the list of signature algorithms a security key or a passkey is allowed to use. Every one available today is broken by a quantum computer, so the value of writing it down now is knowing where to look later.

What to do. No post-quantum COSE algorithm is registered for WebAuthn yet. Record the exposure and keep the list short, so there is less to change when one is.

  1. core/src/main/java/org/keycloak/mdoc/MdocAlgorithm.java:40 ES384(Algorithm.ES384, COSEAlgorithmIdentifier.ES384),
  2. services/src/main/java/org/keycloak/authentication/requiredactions/WebAuthnRegister.java:427 algs.add(COSEAlgorithmIdentifier.ES384.getValue());
cose.algorithm
ECDSA-P521 Quantum-vulnerable 2 places See details

COSE algorithm identifier

A COSE algorithm named as an identifier or as its IANA registry number - `COSEAlgorithmIdentifier.ES256`, or `alg: -7` in a WebAuthn `pubKeyCredParams`. The names match JOSE's; the numbers are the registry's.

This is the list of signature algorithms a security key or a passkey is allowed to use. Every one available today is broken by a quantum computer, so the value of writing it down now is knowing where to look later.

What to do. No post-quantum COSE algorithm is registered for WebAuthn yet. Record the exposure and keep the list short, so there is less to change when one is.

  1. core/src/main/java/org/keycloak/mdoc/MdocAlgorithm.java:41 ES512(Algorithm.ES512, COSEAlgorithmIdentifier.ES512),
  2. services/src/main/java/org/keycloak/authentication/requiredactions/WebAuthnRegister.java:433 algs.add(COSEAlgorithmIdentifier.ES512.getValue());
cose.algorithm
Ed25519255-bitother/Ed25519 Quantum-vulnerable 2 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

code.named-call
Ed25519255-bitother/Ed25519 Quantum-vulnerable 2 places See details

COSE algorithm identifier

A COSE algorithm named as an identifier or as its IANA registry number - `COSEAlgorithmIdentifier.ES256`, or `alg: -7` in a WebAuthn `pubKeyCredParams`. The names match JOSE's; the numbers are the registry's.

This is the list of signature algorithms a security key or a passkey is allowed to use. Every one available today is broken by a quantum computer, so the value of writing it down now is knowing where to look later.

What to do. No post-quantum COSE algorithm is registered for WebAuthn yet. Record the exposure and keep the list short, so there is less to change when one is.

  1. core/src/main/java/org/keycloak/mdoc/MdocAlgorithm.java:42 EDDSA(Algorithm.EdDSA, COSEAlgorithmIdentifier.EdDSA);
  2. services/src/main/java/org/keycloak/authentication/requiredactions/WebAuthnRegister.java:439 algs.add(COSEAlgorithmIdentifier.EdDSA.getValue());
cose.algorithm
EdDSA Quantum-vulnerable 2 places See details

Classical key material handled through the JCA

`KeyFactory.getInstance()` for a classical algorithm. This indicates the code parses or produces keys of that family, which is a migration surface even where it does no cryptography itself.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. Include this code path in the inventory: it has to accept post-quantum key encodings before the keys themselves can change.

java.keyfactory · CWE-327
RSA Quantum-vulnerable Recorded traffic 2 places See details

Algorithm named in a setting

A setting whose name says it holds an algorithm, given a literal that names one: `withOaepPaddingDigestAlgorithm("SHA-512")`, `signatureAlgorithm = "SHA256withRSA"`, `"digestAlgorithm": "SHA-256"`. The algorithm never reaches a `getInstance()` in this file - it is carried to one somewhere else, often through configuration - so a scan that only reads the factories cannot see it at all.

Something here is configured to use a named algorithm. The code that uses it may be somewhere else entirely, but this is the line that decides which algorithm it is.

What to do. Find what consumes the setting. The migration belongs to that operation; this line is where the choice is actually written down, and usually where it is easiest to change.

config.algorithm-setting · CWE-327
RSA-OAEP Quantum-vulnerable Recorded traffic 2 places See details

Cipher transformation named away from the call

A JCA transformation string - `algorithm/mode/padding` - written somewhere other than a `getInstance()` argument, which is how a codebase that centralises its cryptography passes the choice to a helper. The string is unambiguous wherever it appears: nothing but a transformation is spelled that way.

This names an encryption method as text, and passes it to code elsewhere that does the work. It is the same choice, made in a different place.

What to do. The same migration applies as to the call that consumes it. Move the constant and the call together, so the inventory keeps naming the algorithm after the change.

  1. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:61 providers.put(CryptoConstants.RSA_OAEP, new RSAWrapperAlgorithmProvider(new DefaultRsaKeyEncryptionJWEAlgorithmProvider("RSA/ECB/OAEPWithSHA-1AndMGF1Padding")));
  2. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:62 providers.put(CryptoConstants.RSA_OAEP, new RSAWrapperAlgorithmProvider(new ElytronRsaKeyEncryptionJWEAlgorithmProvider("RSA/ECB/OAEPWithSHA-1AndMGF1Padding")));
java.transformation · CWE-327
RSA-OAEP-SHA256 Quantum-vulnerable Recorded traffic 2 places See details

Cipher transformation named away from the call

A JCA transformation string - `algorithm/mode/padding` - written somewhere other than a `getInstance()` argument, which is how a codebase that centralises its cryptography passes the choice to a helper. The string is unambiguous wherever it appears: nothing but a transformation is spelled that way.

This names an encryption method as text, and passes it to code elsewhere that does the work. It is the same choice, made in a different place.

What to do. The same migration applies as to the call that consumes it. Move the constant and the call together, so the inventory keeps naming the algorithm after the change.

  1. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:62 providers.put(CryptoConstants.RSA_OAEP_256, new RSAWrapperAlgorithmProvider(new DefaultRsaKeyEncryption256JWEAlgorithmProvider("RSA/ECB/OAEPWithSHA-256AndMGF1Padding")));
  2. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:63 providers.put(CryptoConstants.RSA_OAEP_256, new RSAWrapperAlgorithmProvider(new ElytronRsaKeyEncryption256JWEAlgorithmProvider("RSA/ECB/OAEPWithSHA-256AndMGF1Padding")));
java.transformation · CWE-327
RSASSA-PKCS1-SHA256 Quantum-vulnerable 2 places See details

COSE algorithm identifier

A COSE algorithm named as an identifier or as its IANA registry number - `COSEAlgorithmIdentifier.ES256`, or `alg: -7` in a WebAuthn `pubKeyCredParams`. The names match JOSE's; the numbers are the registry's.

This is the list of signature algorithms a security key or a passkey is allowed to use. Every one available today is broken by a quantum computer, so the value of writing it down now is knowing where to look later.

What to do. No post-quantum COSE algorithm is registered for WebAuthn yet. Record the exposure and keep the list short, so there is less to change when one is.

  1. core/src/main/java/org/keycloak/mdoc/MdocAlgorithm.java:33 RS256(Algorithm.RS256, COSEAlgorithmIdentifier.RS256),
  2. services/src/main/java/org/keycloak/authentication/requiredactions/WebAuthnRegister.java:424 algs.add(COSEAlgorithmIdentifier.RS256.getValue());
cose.algorithm
RSASSA-PKCS1-SHA256 Quantum-vulnerable 2 places See details

Certificate signed or verified

A certificate or signing request is signed - `x509.CreateCertificate()`, a pyca `builder.sign()`, a Bouncy Castle `certBuilder.build(signer)` - or its signature or chain is checked: `CheckSignature()`, `Verify(x509.VerifyOptions{})`, `CertPathValidator`, `is_signature_valid`. The algorithm is the signing key's.

This code puts a signature on a digital identity document, or checks one.

What to do. Find the key behind the signature. Issuing certificates is where an ML-DSA key eventually goes, and the relying parties that verify them have to accept it first.

x509.signature
RSASSA-PKCS1-SHA384 Quantum-vulnerable 2 places See details

COSE algorithm identifier

A COSE algorithm named as an identifier or as its IANA registry number - `COSEAlgorithmIdentifier.ES256`, or `alg: -7` in a WebAuthn `pubKeyCredParams`. The names match JOSE's; the numbers are the registry's.

This is the list of signature algorithms a security key or a passkey is allowed to use. Every one available today is broken by a quantum computer, so the value of writing it down now is knowing where to look later.

What to do. No post-quantum COSE algorithm is registered for WebAuthn yet. Record the exposure and keep the list short, so there is less to change when one is.

  1. core/src/main/java/org/keycloak/mdoc/MdocAlgorithm.java:34 RS384(Algorithm.RS384, COSEAlgorithmIdentifier.RS384),
  2. services/src/main/java/org/keycloak/authentication/requiredactions/WebAuthnRegister.java:430 algs.add(COSEAlgorithmIdentifier.RS384.getValue());
cose.algorithm
RSASSA-PKCS1-SHA512 Quantum-vulnerable 2 places See details

COSE algorithm identifier

A COSE algorithm named as an identifier or as its IANA registry number - `COSEAlgorithmIdentifier.ES256`, or `alg: -7` in a WebAuthn `pubKeyCredParams`. The names match JOSE's; the numbers are the registry's.

This is the list of signature algorithms a security key or a passkey is allowed to use. Every one available today is broken by a quantum computer, so the value of writing it down now is knowing where to look later.

What to do. No post-quantum COSE algorithm is registered for WebAuthn yet. Record the exposure and keep the list short, so there is less to change when one is.

  1. core/src/main/java/org/keycloak/mdoc/MdocAlgorithm.java:35 RS512(Algorithm.RS512, COSEAlgorithmIdentifier.RS512),
  2. services/src/main/java/org/keycloak/authentication/requiredactions/WebAuthnRegister.java:436 algs.add(COSEAlgorithmIdentifier.RS512.getValue());
cose.algorithm
DSA Quantum-vulnerable 1 place See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/SignatureUtil.java:212 sig = Signature.getInstance(PicketLinkFederationConstants.DSA_SIGNATURE_ALGORITHM);
code.algorithm-constant
ECsecg/secp256r1 Quantum-vulnerable 1 place See details

Elliptic-curve cryptography through BouncyCastle

A BouncyCastle elliptic-curve class. `ECDHBasicAgreement` in particular is key establishment and carries harvest-now-decrypt-later exposure.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. An elliptic-curve key pair. The source does not say whether it signs or agrees a shared secret, and the curve alone cannot: the same curve serves both.

What to do. ML-DSA-65 for signatures, ML-KEM-768 for key establishment.

  1. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:108 ECNamedCurveParameterSpec spec = ECNamedCurveTable.getParameterSpec(curveName);
java.bouncycastle.ec · CWE-327
EC Quantum-vulnerable 1 place See details

Elliptic-curve cryptography through BouncyCastle

A BouncyCastle elliptic-curve class. `ECDHBasicAgreement` in particular is key establishment and carries harvest-now-decrypt-later exposure.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. An elliptic-curve key pair. The source does not say whether it signs or agrees a shared secret, and the curve alone cannot: the same curve serves both.

What to do. ML-DSA-65 for signatures, ML-KEM-768 for key establishment.

  1. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:155 X9ECParameters params = ECNamedCurveTable.getByName(curveName);
java.bouncycastle.ec · CWE-327
EC Quantum-vulnerable 1 place See details

Classical key material handled through the JCA

`KeyFactory.getInstance()` for a classical algorithm. This indicates the code parses or produces keys of that family, which is a migration surface even where it does no cryptography itself.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. An elliptic-curve key pair. The source does not say whether it signs or agrees a shared secret, and the curve alone cannot: the same curve serves both.

What to do. Include this code path in the inventory: it has to accept post-quantum key encodings before the keys themselves can change.

java.keyfactory · CWE-327
ECDSA Quantum-vulnerable 1 place See details

Algorithm named in a setting

A setting whose name says it holds an algorithm, given a literal that names one: `withOaepPaddingDigestAlgorithm("SHA-512")`, `signatureAlgorithm = "SHA256withRSA"`, `"digestAlgorithm": "SHA-256"`. The algorithm never reaches a `getInstance()` in this file - it is carried to one somewhere else, often through configuration - so a scan that only reads the factories cannot see it at all.

Something here is configured to use a named algorithm. The code that uses it may be somewhere else entirely, but this is the line that decides which algorithm it is.

What to do. Find what consumes the setting. The migration belongs to that operation; this line is where the choice is actually written down, and usually where it is easiest to change.

config.algorithm-setting · CWE-327
Ed448 Quantum-vulnerable 1 place See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

code.named-call
RSA Quantum-vulnerable Recorded traffic 1 place See details

Private key read or written as PEM

`new JcaPEMKeyConverter().getPrivateKey(..)`, a `PEMKeyPair` read from a `PEMParser`, or a `JcaPKCS8Generator`. The algorithm is the key's; where every other use in the file is one key type, the finding is named for it.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. Find where the key file lives and how it is protected. It is re-issued when the algorithm changes.

java.private-key
RSA4096-bit Quantum-vulnerable Recorded traffic 1 place See details

Key type chosen by a setting

A named curve written as a string - `elliptic_curve="secp256r1"`, `"P-384"` in a list of accepted curves - or an RSA key size in a setting that names RSA (`rsa_key_size=2048`). The curve is reported as ECDSA where the file signs, ECDH where it agrees keys, and EC where it does both or neither.

This setting picks the kind of key the software makes.

What to do. The setting is where the key type changes; keep the list short so a post-quantum option can be added in one place.

code.curve
RSA-PSS Quantum-vulnerable 1 place See details

Classical signature algorithm through the JCA

`Signature.getInstance()` with a classical algorithm. The digest and the key algorithm are split out of the JCA name, so `SHA1withRSA` reports both the broken digest and the quantum-vulnerable key.

A quantum computer of sufficient size breaks this completely. It has to be replaced, not tuned. Broken by Shor's algorithm on a cryptographically relevant quantum computer.

What to do. ML-DSA-65 (FIPS 204). Where the verifier cannot be changed, sign twice and publish both signatures.

java.signature · CWE-327
RSASSA-PKCS1-SHA256 Quantum-vulnerable 1 place See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:30 RSA_SHA256("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", "http://www.w3.org/2001/04/xmlenc#sha256", "SHA256withRSA"),
xmldsig.algorithm · CWE-327
RSASSA-PKCS1-SHA512 Quantum-vulnerable 1 place See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:32 RSA_SHA512("http://www.w3.org/2001/04/xmldsig-more#rsa-sha512", "http://www.w3.org/2001/04/xmlenc#sha512", "SHA512withRSA"),
xmldsig.algorithm · CWE-327
RSASSA-PKCS1v15 Quantum-vulnerable 1 place See details

Algorithm named in a setting

A setting whose name says it holds an algorithm, given a literal that names one: `withOaepPaddingDigestAlgorithm("SHA-512")`, `signatureAlgorithm = "SHA256withRSA"`, `"digestAlgorithm": "SHA-256"`. The algorithm never reaches a `getInstance()` in this file - it is carried to one somewhere else, often through configuration - so a scan that only reads the factories cannot see it at all.

Something here is configured to use a named algorithm. The code that uses it may be somewhere else entirely, but this is the line that decides which algorithm it is.

What to do. Find what consumes the setting. The migration belongs to that operation; this line is where the choice is actually written down, and usually where it is easiest to change.

config.algorithm-setting · CWE-327
RSASSA-PSS-SHA256 Quantum-vulnerable 1 place See details

COSE algorithm identifier

A COSE algorithm named as an identifier or as its IANA registry number - `COSEAlgorithmIdentifier.ES256`, or `alg: -7` in a WebAuthn `pubKeyCredParams`. The names match JOSE's; the numbers are the registry's.

This is the list of signature algorithms a security key or a passkey is allowed to use. Every one available today is broken by a quantum computer, so the value of writing it down now is knowing where to look later.

What to do. No post-quantum COSE algorithm is registered for WebAuthn yet. Record the exposure and keep the list short, so there is less to change when one is.

  1. core/src/main/java/org/keycloak/mdoc/MdocAlgorithm.java:36 PS256(Algorithm.PS256, COSEAlgorithmIdentifier.PS256),
cose.algorithm
RSASSA-PSS-SHA256 Quantum-vulnerable 1 place See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:31 RSA_SHA256_MGF1("http://www.w3.org/2007/05/xmldsig-more#sha256-rsa-MGF1", "http://www.w3.org/2001/04/xmlenc#sha256", "SHA256withRSAandMGF1"),
xmldsig.algorithm · CWE-327
RSASSA-PSS-SHA384 Quantum-vulnerable 1 place See details

COSE algorithm identifier

A COSE algorithm named as an identifier or as its IANA registry number - `COSEAlgorithmIdentifier.ES256`, or `alg: -7` in a WebAuthn `pubKeyCredParams`. The names match JOSE's; the numbers are the registry's.

This is the list of signature algorithms a security key or a passkey is allowed to use. Every one available today is broken by a quantum computer, so the value of writing it down now is knowing where to look later.

What to do. No post-quantum COSE algorithm is registered for WebAuthn yet. Record the exposure and keep the list short, so there is less to change when one is.

  1. core/src/main/java/org/keycloak/mdoc/MdocAlgorithm.java:37 PS384(Algorithm.PS384, COSEAlgorithmIdentifier.PS384),
cose.algorithm
RSASSA-PSS-SHA512 Quantum-vulnerable 1 place See details

COSE algorithm identifier

A COSE algorithm named as an identifier or as its IANA registry number - `COSEAlgorithmIdentifier.ES256`, or `alg: -7` in a WebAuthn `pubKeyCredParams`. The names match JOSE's; the numbers are the registry's.

This is the list of signature algorithms a security key or a passkey is allowed to use. Every one available today is broken by a quantum computer, so the value of writing it down now is knowing where to look later.

What to do. No post-quantum COSE algorithm is registered for WebAuthn yet. Record the exposure and keep the list short, so there is less to change when one is.

  1. core/src/main/java/org/keycloak/mdoc/MdocAlgorithm.java:38 PS512(Algorithm.PS512, COSEAlgorithmIdentifier.PS512),
cose.algorithm
RSASSA-PSS-SHA512 Quantum-vulnerable 1 place See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:33 RSA_SHA512_MGF1("http://www.w3.org/2007/05/xmldsig-more#sha512-rsa-MGF1", "http://www.w3.org/2001/04/xmlenc#sha512", "SHA512withRSAandMGF1"),
xmldsig.algorithm · CWE-327
TLS-1.3 Quantum-vulnerable 5 places See details

TLS used in code

A TLS connection, context or setting made in code: `SSLContexts.createDefault()`, `SSLSocketFactory.getDefault()`, `setEnabledProtocols()`, `setEnabledCipherSuites()`, `startHandshake()`, Go `tls.VersionTLS12` and `tls.Dial()`, Python `ssl.create_default_context()`, Node `tls.connect()`, and version names such as `"TLSv1.2"`. Every TLS key exchange in general use is classical, so recorded traffic is exposed.

This code opens or configures an encrypted connection. Its key exchange is the part a future quantum computer breaks, which exposes traffic recorded today.

What to do. TLS 1.3 everywhere, then a hybrid group such as X25519MLKEM768 as the platform offers it.

  1. model/infinispan/src/main/java/org/keycloak/spi/infinispan/impl/embedded/JGroupsConfigurator.java:101 private static final String TLS_PROTOCOL_VERSION = "TLSv1.3";
  2. model/infinispan/src/main/java/org/keycloak/spi/infinispan/impl/embedded/JGroupsConfigurator.java:238 serverParameters.setProtocols(new String[]{TLS_PROTOCOL_VERSION});
  3. quarkus/config-api/src/main/java/org/keycloak/config/HttpOptions.java:71 .expectedValues(Arrays.asList("TLSv1.3", "TLSv1.2"))
  4. quarkus/config-api/src/main/java/org/keycloak/config/HttpOptions.java:73 .defaultValue(Arrays.asList("TLSv1.3", "TLSv1.2"))
  5. util/embedded-ldap/src/main/java/org/keycloak/util/ldap/TLS13StartTlsHandler.java:105 sslFilter.setEnabledProtocols(new String[]{"TLSv1.2", "TLSv1.3"});
tls.protocol · CWE-757
TLS-1.2 Quantum-vulnerable 3 places See details

TLS used in code

A TLS connection, context or setting made in code: `SSLContexts.createDefault()`, `SSLSocketFactory.getDefault()`, `setEnabledProtocols()`, `setEnabledCipherSuites()`, `startHandshake()`, Go `tls.VersionTLS12` and `tls.Dial()`, Python `ssl.create_default_context()`, Node `tls.connect()`, and version names such as `"TLSv1.2"`. Every TLS key exchange in general use is classical, so recorded traffic is exposed.

This code opens or configures an encrypted connection. Its key exchange is the part a future quantum computer breaks, which exposes traffic recorded today.

What to do. TLS 1.3 everywhere, then a hybrid group such as X25519MLKEM768 as the platform offers it.

  1. quarkus/config-api/src/main/java/org/keycloak/config/HttpOptions.java:71 .expectedValues(Arrays.asList("TLSv1.3", "TLSv1.2"))
  2. quarkus/config-api/src/main/java/org/keycloak/config/HttpOptions.java:73 .defaultValue(Arrays.asList("TLSv1.3", "TLSv1.2"))
  3. util/embedded-ldap/src/main/java/org/keycloak/util/ldap/TLS13StartTlsHandler.java:105 sslFilter.setEnabledProtocols(new String[]{"TLSv1.2", "TLSv1.3"});
tls.protocol · CWE-757
SHA-256 Reduced margin 64 places See details

Hash algorithm through the JCA

`MessageDigest.getInstance()`. MD5 and SHA-1 are reported as already broken; SHA-256 is reported as a reduced margin rather than a defect.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Pre-image resistance falls to about 128 bits of quantum work. Adequate for most uses; SHA-384 restores the full margin where a signature must last decades.

What to do. SHA-256 as the floor, SHA-384 where the digest protects something that must remain verifiable for decades.

  1. common/src/main/java/org/keycloak/common/util/KeyUtils.java:42 private static final String DEFAULT_MESSAGE_DIGEST = "SHA-256";
  2. common/src/main/java/org/keycloak/common/util/KeyUtils.java:100 return Base64Url.encode(MessageDigest.getInstance(DEFAULT_MESSAGE_DIGEST).digest(key.getEncoded()));
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:21 public static final String RS256 = "SHA256withRSA";
  4. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:27 public static final String ES256 = "SHA256withECDSA";
  5. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:30 public static final String PS256 = "SHA256withRSAandMGF1";
  6. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:38 public static final String SHA256 = "SHA-256";
  7. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:50 return RS256;
  8. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:62 return ES256;
  9. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:68 return PS256;
  10. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:92 return SHA256;
  11. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:98 return SHA256;
  12. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:104 return SHA256;
  13. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:110 return SHA256;
  14. core/src/main/java/org/keycloak/jose/jwk/JWK.java:152 sha256x509Thumbprint = PemUtils.generateThumbprint(x509CertificateChain, "SHA-256");
  15. core/src/main/java/org/keycloak/jose/jwk/RSAPublicJWK.java:76 sha256x509Thumbprint = PemUtils.generateThumbprint(x509CertificateChain, "SHA-256");
  16. core/src/main/java/org/keycloak/jose/jws/crypto/ECDSAProvider.java:40 return "SHA256withECDSA";
  17. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:39 return "SHA256withRSA";
  18. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:45 return "SHA256withRSAandMGF1";
  19. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:57 return Signature.getInstance(getJavaAlgorithm(alg));
  20. core/src/main/java/org/keycloak/util/JWKSUtils.java:52 private static final String JWK_THUMBPRINT_DEFAULT_HASH_ALGORITHM = "SHA-256";
  21. core/src/main/java/org/keycloak/util/JWKSUtils.java:152 return computeThumbprint(key, JWK_THUMBPRINT_DEFAULT_HASH_ALGORITHM);
  22. core/src/main/java/org/keycloak/util/JWKSUtils.java:175 byte[] hash = HashUtils.hash(hashAlg, bytes);
  23. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:139 sigGen = new JcaContentSignerBuilder("SHA256WithECDSA").setProvider(BouncyIntegration.PROVIDER)
  24. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:143 sigGen = new JcaContentSignerBuilder("SHA256WithRSAEncryption").setProvider(BouncyIntegration.PROVIDER)
  25. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:200 signerBuilder = new JcaContentSignerBuilder("SHA256WithRSAEncryption")
  26. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:206 signerBuilder = new JcaContentSignerBuilder("SHA256WithECDSA")
  27. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:316 ContentSigner contentSigner = new JcaContentSignerBuilder("SHA256withRSA")
  28. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultRsaKeyEncryption256JWEAlgorithmProvider.java:21 AlgorithmParameterSpec paramSpec = new OAEPParameterSpec("SHA-256", "MGF1", MGF1ParameterSpec.SHA256,
  29. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronCertificateUtilsProvider.java:140 cbuilder.setSignatureAlgorithmName("SHA256withECDSA");
  30. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronCertificateUtilsProvider.java:143 cbuilder.setSignatureAlgorithmName("SHA256withRSA");
  31. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronCertificateUtilsProvider.java:202 cbuilder.setSignatureAlgorithmName("SHA256withECDSA");
  32. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronCertificateUtilsProvider.java:205 cbuilder.setSignatureAlgorithmName("SHA256withRSA");
  33. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronCertificateUtilsProvider.java:343 .setSignatureAlgorithmName("SHA256withRSA");
  34. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronRsaKeyEncryption256JWEAlgorithmProvider.java:39 AlgorithmParameterSpec paramSpec = new OAEPParameterSpec("SHA-256", "MGF1", MGF1ParameterSpec.SHA256,
  35. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:139 sigGen = new JcaContentSignerBuilder("SHA256WithECDSA").setProvider(BouncyIntegration.PROVIDER)
  36. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:143 sigGen = new JcaContentSignerBuilder("SHA256WithRSAEncryption").setProvider(BouncyIntegration.PROVIDER)
  37. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:203 signerBuilder = new JcaContentSignerBuilder("SHA256WithRSAEncryption")
  38. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:208 signerBuilder = new JcaContentSignerBuilder("SHA256WithECDSA")
  39. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:319 ContentSigner contentSigner = new JcaContentSignerBuilder("SHA256withRSA")
  40. operator/src/main/java/org/keycloak/operator/Utils.java:108 return new BigInteger(1, messageDigest.digest()).toString(16);
  41. operator/src/main/java/org/keycloak/operator/Utils.java:114 return new BigInteger(1, messageDigest.digest()).toString(16);
  42. operator/src/main/java/org/keycloak/operator/Utils.java:120 return MessageDigest.getInstance("SHA-256");
  43. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:30 RSA_SHA256("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", "http://www.w3.org/2001/04/xmlenc#sha256", "SHA256withRSA"),
  44. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:31 RSA_SHA256_MGF1("http://www.w3.org/2007/05/xmldsig-more#sha256-rsa-MGF1", "http://www.w3.org/2001/04/xmlenc#sha256", "SHA256withRSAandMGF1"),
  45. server-spi-private/src/main/java/org/keycloak/broker/provider/AbstractIdentityProvider.java:142 md = MessageDigest.getInstance("SHA-256");
  46. server-spi-private/src/main/java/org/keycloak/broker/provider/AbstractIdentityProvider.java:147 byte[] check = md.digest(input.getBytes(StandardCharsets.UTF_8));
  47. server-spi-private/src/main/java/org/keycloak/models/oid4vci/CredentialScopeModel.java:48 public static final String VC_BUILD_CONFIG_HASH_ALGORITHM_DEFAULT = "SHA-256";
  48. services/src/main/java/org/keycloak/protocol/docker/DockerKeyIdentifier.java:37 final MessageDigest sha256 = MessageDigest.getInstance("SHA-256");
  49. services/src/main/java/org/keycloak/protocol/docker/DockerKeyIdentifier.java:38 final byte[] hashed = sha256.digest(key.getEncoded());
  50. services/src/main/java/org/keycloak/protocol/oid4vc/issuance/signing/vcdm/Ed255192018Suite.java:129 MessageDigest md = MessageDigest.getInstance("SHA-256");
  51. services/src/main/java/org/keycloak/protocol/oid4vc/issuance/signing/vcdm/Ed255192018Suite.java:130 return md.digest(transformedData);
  52. services/src/main/java/org/keycloak/protocol/oidc/mappers/SHA256PairwiseSubMapper.java:27 private static final String HASH_ALGORITHM = "SHA-256";
  53. services/src/main/java/org/keycloak/protocol/oidc/mappers/SHA256PairwiseSubMapper.java:90 sha256 = MessageDigest.getInstance(HASH_ALGORITHM);
  54. services/src/main/java/org/keycloak/protocol/oidc/mappers/SHA256PairwiseSubMapper.java:96 byte[] hash = sha256.digest(salt);
  55. services/src/main/java/org/keycloak/protocol/oidc/par/endpoints/AbstractParEndpoint.java:88 hash = MessageDigest.getInstance("SHA-256").digest(inputData.getBytes(StandardCharsets.UTF_8));
  56. services/src/main/java/org/keycloak/services/clientpolicy/executor/PKCEEnforcerExecutor.java:230 MessageDigest md = MessageDigest.getInstance("SHA-256");
  57. services/src/main/java/org/keycloak/services/clientpolicy/executor/PKCEEnforcerExecutor.java:232 byte[] digestBytes = md.digest();
  58. services/src/main/java/org/keycloak/services/resources/IdentityBrokerService.java:283 md = MessageDigest.getInstance("SHA-256");
  59. services/src/main/java/org/keycloak/services/resources/IdentityBrokerService.java:288 byte[] check = md.digest(input.getBytes(StandardCharsets.UTF_8));
  60. services/src/main/java/org/keycloak/services/util/MtlsHoKTokenUtil.java:38 private static final String DIGEST_ALG = "SHA-256";
  61. services/src/main/java/org/keycloak/services/util/MtlsHoKTokenUtil.java:139 MessageDigest md = MessageDigest.getInstance(DIGEST_ALG);
  62. services/src/main/java/org/keycloak/services/util/MtlsHoKTokenUtil.java:141 String DERX509Base64UrlEncoded = Base64Url.encode(md.digest());
  63. services/src/main/java/org/keycloak/utils/BrokerUtil.java:44 MessageDigest md = MessageDigest.getInstance("SHA-256");
  64. services/src/main/java/org/keycloak/utils/BrokerUtil.java:46 byte[] check = md.digest(input.getBytes(StandardCharsets.UTF_8));
java.messagedigest · CWE-328
SHA-256 Reduced margin 13 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. core/src/main/java/org/keycloak/jose/jws/crypto/HashUtils.java:80 byte[] hashedOutput = hash(JavaAlgorithm.SHA256, inputBytes);
  2. core/src/main/java/org/keycloak/mdoc/MdocCredential.java:243 return HashUtils.hash(JavaAlgorithm.SHA256, value);
  3. core/src/main/java/org/keycloak/sdjwt/IssuerSignedJWT.java:207 .orElse(OID4VCConstants.SD_HASH_DEFAULT_ALGORITHM);
  4. core/src/main/java/org/keycloak/sdjwt/IssuerSignedJWT.java:218 OID4VCConstants.SD_HASH_DEFAULT_ALGORITHM, "sha-384", "sha-512",
  5. core/src/main/java/org/keycloak/sdjwt/IssuerSignedJWT.java:398 hashAlg = hashAlg == null ? OID4VCConstants.SD_HASH_DEFAULT_ALGORITHM : hashAlg;
  6. core/src/main/java/org/keycloak/sdjwt/SdJwt.java:308 return issuerSignedJwt.getSdHashAlgorithm().orElse(OID4VCConstants.SD_HASH_DEFAULT_ALGORITHM);
  7. core/src/main/java/org/keycloak/sdjwt/vp/SdJwtVP.java:141 .orElse(JavaAlgorithm.SHA256.toLowerCase());
  8. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:97 providers.put(CryptoConstants.RSA_OAEP_256, new RSAWrapperAlgorithmProvider(new FIPSRsaKeyEncryptionJWEAlgorithmProvider(FipsRSA.WRAP_OAEP.withDigest(FipsSHS.Algorithm.SHA256))));
  9. model/infinispan/src/main/java/org/keycloak/infinispan/compatibility/CachingEmbeddedMetadataProvider.java:79 var hash = HashUtils.hash(JavaAlgorithm.SHA256, Files.readAllBytes(filePath));
  10. saml-core/src/main/java/org/keycloak/saml/processing/core/util/XMLEncryptionUtil.java:188 keyEncryptionDigestMethod = XMLCipher.SHA256; // default digest method to SHA256
  11. services/src/main/java/org/keycloak/authentication/authenticators/x509/AbstractX509ClientCertificateAuthenticator.java:195 return Hex.encodeHexString(HashUtils.hash(JavaAlgorithm.SHA256, certs[0].getEncoded()));
  12. services/src/main/java/org/keycloak/broker/oid4vp/ClientIdentifier.java:41 return Base64Url.encode(HashUtils.hash(JavaAlgorithm.SHA256, leafCertificate.getEncoded()));
  13. services/src/main/java/org/keycloak/crypto/SHA256HashProviderFactory.java:27 public static final String ID = JavaAlgorithm.SHA256;
code.algorithm-constant
AES Reduced margin 12 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:78 case Algorithm.AES:
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:127 case Algorithm.AES:
  3. services/src/main/java/org/keycloak/jose/jws/DefaultTokenManager.java:305 return Algorithm.AES;
  4. services/src/main/java/org/keycloak/keys/DefaultKeyManager.java:169 KeyWrapper key = getActiveKey(realm, KeyUse.ENC, Algorithm.AES);
  5. services/src/main/java/org/keycloak/keys/DefaultKeyManager.java:197 KeyWrapper key = getKey(realm, kid, KeyUse.ENC, Algorithm.AES);
  6. services/src/main/java/org/keycloak/keys/DefaultKeyManager.java:234 return getKeysStream(realm, KeyUse.ENC, Algorithm.AES)
  7. services/src/main/java/org/keycloak/keys/GeneratedAesKeyProviderFactory.java:66 if (keyUse.equals(KeyUse.ENC) && algorithm.equals(Algorithm.AES)) {
  8. services/src/main/java/org/keycloak/keys/GeneratedAesKeyProvider.java:31 super(model, KeyUse.ENC, KeyType.OCT, Algorithm.AES);
  9. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProviderFactory.java:193 List.of(Algorithm.AES, Algorithm.EdDSA),
  10. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:117 case Algorithm.AES ->
  11. services/src/main/java/org/keycloak/protocol/oidc/grants/ciba/channel/CIBAAuthenticationRequest.java:64 SecretKey aesKey = session.keys().getActiveKey(session.getContext().getRealm(), KeyUse.ENC, Algorithm.AES).getSecretKey();
  12. services/src/main/java/org/keycloak/protocol/oidc/grants/ciba/channel/CIBAAuthenticationRequest.java:161 SecretKey aesKey = session.keys().getActiveKey(session.getContext().getRealm(), KeyUse.ENC, Algorithm.AES).getSecretKey();
code.algorithm-constant
Kerberos Reduced margin 11 places See details

Kerberos or SPNEGO authentication

`javax.security.auth.kerberos` or a GSS-API call. Kerberos itself is symmetric and survives Shor; its PKINIT certificate flow is public-key and does not. The encryption types configured for the realm decide whether it is also a present-day concern.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Kerberos is symmetric at its core, so Shor does not break it. The surrounding PKINIT certificate flow is public-key and does fall.

What to do. Restrict the realm to AES encryption types, and treat PKINIT certificates as part of the public-key migration.

  1. common/src/main/java/org/keycloak/common/util/KerberosJdkProvider.java:57 public abstract KerberosTicket gssCredentialToKerberosTicket(KerberosTicket kerberosTicket, GSSCredential gssCredential);
  2. common/src/main/java/org/keycloak/common/util/KerberosSerializationUtils.java:54 public static String serializeCredential(KerberosTicket kerberosTicket, GSSCredential gssCredential) throws KerberosSerializationException {
  3. federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/KerberosUsernamePasswordAuthenticator.java:302 context = manager.createContext(target, KerberosConstants.KRB5_OID, credential, GSSContext.DEFAULT_LIFETIME);
  4. federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/KerberosUsernamePasswordAuthenticator.java:320 return clientContext.getContext().initSecContext(token, 0, token.length);
  5. federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/KerberosUsernamePasswordAuthenticator.java:350 context = manager.createContext(credential);
  6. federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/KerberosUsernamePasswordAuthenticator.java:367 return serverContext.getContext().acceptSecContext(token, 0, token.length);
  7. federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/SPNEGOAuthenticator.java:165 GSSContext gssContext = manager.createContext(gssCredential);
  8. federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/SPNEGOAuthenticator.java:168 byte[] respToken = gssContext.acceptSecContext(inputToken, 0, inputToken.length);
  9. federation/kerberos/src/main/java/org/keycloak/federation/kerberos/KerberosFederationProvider.java:104 return findOrCreateAuthenticatedUser(realm, new KerberosPrincipal(kerberosPrincipal));
  10. federation/kerberos/src/main/java/org/keycloak/federation/kerberos/KerberosPrincipal.java:25 public class KerberosPrincipal {
  11. federation/ldap/src/main/java/org/keycloak/storage/ldap/LDAPStorageProvider.java:704 KerberosPrincipal kerberosPrinc = new KerberosPrincipal(kerberosPrincipal);
java.kerberos
AES-GCM Reduced margin 9 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. core/src/main/java/org/keycloak/jose/jwe/enc/AesGcmEncryptionProvider.java:91 Cipher cipher = CryptoIntegration.getProvider().getAesGcmCipher();
  2. core/src/main/java/org/keycloak/jose/jwe/enc/AesGcmEncryptionProvider.java:101 Cipher cipher = CryptoIntegration.getProvider().getAesGcmCipher();
  3. core/src/main/java/org/keycloak/jose/jwe/JWERegistry.java:41 ENC_PROVIDERS.put(JWEConstants.A128GCM, new AesGcmJWEEncryptionProvider(JWEConstants.A128GCM));
  4. core/src/main/java/org/keycloak/jose/jwe/JWERegistry.java:42 ENC_PROVIDERS.put(JWEConstants.A192GCM, new AesGcmJWEEncryptionProvider(JWEConstants.A192GCM));
  5. core/src/main/java/org/keycloak/jose/jwe/JWERegistry.java:43 ENC_PROVIDERS.put(JWEConstants.A256GCM, new AesGcmJWEEncryptionProvider(JWEConstants.A256GCM));
  6. services/src/main/java/org/keycloak/crypto/Aes128GcmContentEncryptionProviderFactory.java:33 return new AesGcmContentEncryptionProvider(session, ID);
  7. services/src/main/java/org/keycloak/crypto/Aes192GcmContentEncryptionProviderFactory.java:33 return new AesGcmContentEncryptionProvider(session, ID);
  8. services/src/main/java/org/keycloak/crypto/Aes256GcmContentEncryptionProviderFactory.java:33 return new AesGcmContentEncryptionProvider(session, ID);
  9. services/src/main/java/org/keycloak/crypto/AesGcmContentEncryptionProvider.java:36 return new AesGcmJWEEncryptionProvider(jweAlgorithmName);
code.named-call
SHA-256 Reduced margin 9 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. model/infinispan/src/main/java/org/keycloak/infinispan/compatibility/CachingEmbeddedMetadataProvider.java:63 meta.put(CONFIG, sha256Of(Paths.get(config.get(CONFIG))));
  2. quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/compatibility/DatabaseCompatibilityMetadataProvider.java:104 String hash = HashUtils.sha256UrlEncodedHash(changeSetJson, StandardCharsets.UTF_8);
  3. services/src/main/java/org/keycloak/organization/authentication/authenticators/broker/IdpAddOrganizationMemberAuthenticator.java:169 return "kc.org.broker.email.verified." + HashUtils.sha256UrlEncodedHash(binding, StandardCharsets.UTF_8);
  4. services/src/main/java/org/keycloak/protocol/oid4vc/issuance/keybinding/JwtCNonceHandler.java:260 String hash = HashUtils.sha256UrlEncodedHash(cNonce.trim(), StandardCharsets.UTF_8);
  5. services/src/main/java/org/keycloak/protocol/oid4vc/refresh/OID4VCIRefreshTokenProvider.java:379 return ROTATION_KEY_PREFIX + HashUtils.sha256UrlEncodedHash(realm.getId() + "." + familyId, StandardCharsets.UTF_8);
  6. services/src/main/java/org/keycloak/protocol/oidc/grants/PreAuthorizedCodeGrantType.java:403 String hash = HashUtils.sha256UrlEncodedHash(code.trim(), StandardCharsets.UTF_8);
  7. services/src/main/java/org/keycloak/protocol/oidc/mappers/SHA256PairwiseSubMapper.java:39 pairwise.setProtocolMapper(new SHA256PairwiseSubMapper().getId());
  8. services/src/main/java/org/keycloak/protocol/oidc/utils/PkceUtils.java:51 return HashUtils.sha256UrlEncodedHash(codeVerifier, StandardCharsets.ISO_8859_1);
  9. services/src/main/java/org/keycloak/services/clientregistration/policy/DefaultClientRegistrationPolicies.java:53 new SHA256PairwiseSubMapper().getId(),
code.named-call
AES-128-KW Reduced margin 8 places See details

Classical public-key cipher through the JCA

`Cipher.getInstance()` with a transformation whose algorithm component is a public-key or legacy symmetric cipher. The transformation string is parsed into algorithm, mode and padding, so `RSA/ECB/PKCS1Padding` is separated from `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Grover's algorithm halves the effective strength; the parameter, not the design, is the problem.

What to do. For RSA encryption, move to ML-KEM-768 and keep RSA-OAEP only as the classical half of a hybrid during transition.

  1. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/AesKeyWrapAlgorithmProvider.java:36 Cipher cipher = Cipher.getInstance("AESWrap_128");
  2. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/AesKeyWrapAlgorithmProvider.java:38 return cipher.unwrap(encodedCek, "AES", Cipher.SECRET_KEY).getEncoded();
  3. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/AesKeyWrapAlgorithmProvider.java:43 Cipher cipher = Cipher.getInstance("AESWrap_128");
  4. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/AesKeyWrapAlgorithmProvider.java:45 return cipher.wrap(keyStorage.getCEKKey(KeyUse.ENCRYPTION, false));
  5. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:79 Cipher cipher = Cipher.getInstance(getAesWrapAlgorithm(header.getAlgorithm()));
  6. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:81 return cipher.unwrap(encodedCek, "AES", Cipher.SECRET_KEY).getEncoded();
  7. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:112 Cipher cipher = Cipher.getInstance(getAesWrapAlgorithm(header.getAlgorithm()));
  8. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:115 return cipher.wrap(new SecretKeySpec(cekBytes, "AES"));
java.cipher · CWE-327
AES Reduced margin 7 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

code.named-call
AES Reduced margin 6 places See details

Classical public-key cipher through the JCA

`Cipher.getInstance()` with a transformation whose algorithm component is a public-key or legacy symmetric cipher. The transformation string is parsed into algorithm, mode and padding, so `RSA/ECB/PKCS1Padding` is separated from `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Grover's algorithm halves the effective strength; the parameter, not the design, is the problem. The key size was not visible at this call site, so the weaker case is assumed.

What to do. For RSA encryption, move to ML-KEM-768 and keep RSA-OAEP only as the classical half of a hybrid during transition.

  1. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:143 return Cipher.getInstance("AES/CBC/PKCS7Padding", BouncyIntegration.PROVIDER);
  2. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:148 return Cipher.getInstance("AES/GCM/NoPadding", BouncyIntegration.PROVIDER);
  3. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:143 return Cipher.getInstance("AES/CBC/PKCS5Padding");
  4. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:148 return Cipher.getInstance("AES/GCM/NoPadding");
  5. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:208 return Cipher.getInstance("AES/CBC/PKCS7Padding", BouncyIntegration.PROVIDER);
  6. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:213 return Cipher.getInstance("AES/GCM/NoPadding", BouncyIntegration.PROVIDER);
java.cipher · CWE-327
AES-CBC Reduced margin 6 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. core/src/main/java/org/keycloak/jose/jwe/enc/AesCbcHmacShaEncryptionProvider.java:119 Cipher cipher = CryptoIntegration.getProvider().getAesCbcCipher();
  2. core/src/main/java/org/keycloak/jose/jwe/enc/AesCbcHmacShaEncryptionProvider.java:126 Cipher cipher = CryptoIntegration.getProvider().getAesCbcCipher();
  3. services/src/main/java/org/keycloak/crypto/Aes128CbcHmacSha256ContentEncryptionProviderFactory.java:33 return new AesCbcHmacShaContentEncryptionProvider(session, ID);
  4. services/src/main/java/org/keycloak/crypto/Aes192CbcHmacSha384ContentEncryptionProviderFactory.java:33 return new AesCbcHmacShaContentEncryptionProvider(session, ID);
  5. services/src/main/java/org/keycloak/crypto/Aes256CbcHmacSha512ContentEncryptionProviderFactory.java:33 return new AesCbcHmacShaContentEncryptionProvider(session, ID);
  6. services/src/main/java/org/keycloak/crypto/AesCbcHmacShaContentEncryptionProvider.java:36 return new AesCbcHmacShaJWEEncryptionProvider(jweAlgorithmName);
code.named-call
AES Reduced margin 5 places See details

Key material constructed for a named algorithm

`new SecretKeySpec(bytes, "AES")` and the other key-spec constructors name the algorithm as an argument rather than through `getInstance()`. Code that wraps raw bytes into a key this way often never calls `getInstance()` at all, so the algorithm is invisible to a scan that only looks at the factories.

This wraps raw bytes into a key for a named algorithm. It is part of the same migration as whatever uses that key.

What to do. Wherever this key is used, the same migration applies as to the call that consumes it. Trace it to the operation and treat the two together.

  1. core/src/main/java/org/keycloak/jose/jwe/enc/AesCbcHmacShaEncryptionProvider.java:168 SecretKeySpec aesKey = new SecretKeySpec(cekAesKey, "AES");
  2. core/src/main/java/org/keycloak/jose/jwe/enc/AesGcmEncryptionProvider.java:151 SecretKeySpec aesKey = new SecretKeySpec(cekBytes, "AES");
  3. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:80 cipher.init(Cipher.UNWRAP_MODE, new SecretKeySpec(derivedKey, "AES"));
  4. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:113 cipher.init(Cipher.WRAP_MODE, new SecretKeySpec(derivedKey, "AES"));
  5. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:115 return cipher.wrap(new SecretKeySpec(cekBytes, "AES"));
java.keyspec · CWE-327
SHA-256 Reduced margin 5 places See details

Algorithm named in a setting

A setting whose name says it holds an algorithm, given a literal that names one: `withOaepPaddingDigestAlgorithm("SHA-512")`, `signatureAlgorithm = "SHA256withRSA"`, `"digestAlgorithm": "SHA-256"`. The algorithm never reaches a `getInstance()` in this file - it is carried to one somewhere else, often through configuration - so a scan that only reads the factories cannot see it at all.

Something here is configured to use a named algorithm. The code that uses it may be somewhere else entirely, but this is the line that decides which algorithm it is.

What to do. Find what consumes the setting. The migration belongs to that operation; this line is where the choice is actually written down, and usually where it is easiest to change.

  1. common/src/main/java/org/keycloak/common/util/KeyUtils.java:42 private static final String DEFAULT_MESSAGE_DIGEST = "SHA-256";
  2. core/src/main/java/org/keycloak/OID4VCConstants.java:59 public static final String SD_HASH_DEFAULT_ALGORITHM = "sha-256";
  3. core/src/main/java/org/keycloak/util/JWKSUtils.java:52 private static final String JWK_THUMBPRINT_DEFAULT_HASH_ALGORITHM = "SHA-256";
  4. services/src/main/java/org/keycloak/protocol/oidc/mappers/SHA256PairwiseSubMapper.java:27 private static final String HASH_ALGORITHM = "SHA-256";
  5. services/src/main/java/org/keycloak/services/util/MtlsHoKTokenUtil.java:38 private static final String DIGEST_ALG = "SHA-256";
config.algorithm-setting · CWE-327
AES-192-KW Reduced margin 4 places See details

Classical public-key cipher through the JCA

`Cipher.getInstance()` with a transformation whose algorithm component is a public-key or legacy symmetric cipher. The transformation string is parsed into algorithm, mode and padding, so `RSA/ECB/PKCS1Padding` is separated from `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Grover's algorithm halves the effective strength; the parameter, not the design, is the problem.

What to do. For RSA encryption, move to ML-KEM-768 and keep RSA-OAEP only as the classical half of a hybrid during transition.

  1. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:79 Cipher cipher = Cipher.getInstance(getAesWrapAlgorithm(header.getAlgorithm()));
  2. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:81 return cipher.unwrap(encodedCek, "AES", Cipher.SECRET_KEY).getEncoded();
  3. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:112 Cipher cipher = Cipher.getInstance(getAesWrapAlgorithm(header.getAlgorithm()));
  4. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:115 return cipher.wrap(new SecretKeySpec(cekBytes, "AES"));
java.cipher · CWE-327
AES Reduced margin 3 places See details

Algorithm named in a setting

A setting whose name says it holds an algorithm, given a literal that names one: `withOaepPaddingDigestAlgorithm("SHA-512")`, `signatureAlgorithm = "SHA256withRSA"`, `"digestAlgorithm": "SHA-256"`. The algorithm never reaches a `getInstance()` in this file - it is carried to one somewhere else, often through configuration - so a scan that only reads the factories cannot see it at all.

Something here is configured to use a named algorithm. The code that uses it may be somewhere else entirely, but this is the line that decides which algorithm it is.

What to do. Find what consumes the setting. The migration belongs to that operation; this line is where the choice is actually written down, and usually where it is easiest to change.

config.algorithm-setting · CWE-327
AES-128-CBC Reduced margin 3 places See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:75 key: "http://www.w3.org/2001/04/xmlenc#aes128-cbc",
  2. model/jpa/src/main/java/org/keycloak/connections/jpa/updater/liquibase/custom/JpaUpdate26_4_0_SamlEncryptionAttributes.java:36 statements.add(createInsertQueryForAttribute("saml.encryption.algorithm", "http://www.w3.org/2001/04/xmlenc#aes128-cbc"));
  3. model/storage-private/src/main/java/org/keycloak/storage/datastore/DefaultExportImportManager.java:588 app.setAttribute("saml.encryption.algorithm", "http://www.w3.org/2001/04/xmlenc#aes128-cbc");
xmldsig.algorithm · CWE-327
SHA-256 Reduced margin 3 places See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:122 key: "http://www.w3.org/2001/04/xmlenc#sha256",
  2. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:30 RSA_SHA256("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", "http://www.w3.org/2001/04/xmlenc#sha256", "SHA256withRSA"),
  3. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:31 RSA_SHA256_MGF1("http://www.w3.org/2007/05/xmldsig-more#sha256-rsa-MGF1", "http://www.w3.org/2001/04/xmlenc#sha256", "SHA256withRSAandMGF1"),
xmldsig.algorithm · CWE-327
AES-128128-bit Reduced margin 2 places See details

Key type chosen by a setting

A named curve written as a string - `elliptic_curve="secp256r1"`, `"P-384"` in a list of accepted curves - or an RSA key size in a setting that names RSA (`rsa_key_size=2048`). The curve is reported as ECDSA where the file signs, ECDH where it agrees keys, and EC where it does both or neither.

This setting picks the kind of key the software makes.

What to do. The setting is where the key type changes; keep the list short so a post-quantum option can be added in one place.

code.curve
AES-128-CBC Reduced margin 2 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

code.algorithm-constant
AES-192192-bit Reduced margin 2 places See details

Key type chosen by a setting

A named curve written as a string - `elliptic_curve="secp256r1"`, `"P-384"` in a list of accepted curves - or an RSA key size in a setting that names RSA (`rsa_key_size=2048`). The curve is reported as ECDSA where the file signs, ECDH where it agrees keys, and EC where it does both or neither.

This setting picks the kind of key the software makes.

What to do. The setting is where the key type changes; keep the list short so a post-quantum option can be added in one place.

code.curve
AES-192-CBC Reduced margin 2 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

code.algorithm-constant
SHA-256 Reduced margin 2 places See details

Mask-generation digest named for RSA padding

`MGF1ParameterSpec.SHA256` names the digest inside RSA-OAEP and RSA-PSS padding. It is a separate choice from the digest the signature or the cipher uses, it is frequently left at SHA-1 by default, and a static import of it - `import static java.security.spec.MGF1ParameterSpec.SHA512` - is the only place the choice appears in the file that makes it.

This picks the hash used inside RSA padding. It matters because the default is often SHA-1, which is broken today without any quantum computer.

What to do. The mask-generation digest travels with the RSA key it pads. When that key moves to ML-KEM or ML-DSA the padding goes with it; until then, SHA-256 or better.

  1. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultRsaKeyEncryption256JWEAlgorithmProvider.java:21 AlgorithmParameterSpec paramSpec = new OAEPParameterSpec("SHA-256", "MGF1", MGF1ParameterSpec.SHA256,
  2. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronRsaKeyEncryption256JWEAlgorithmProvider.java:39 AlgorithmParameterSpec paramSpec = new OAEPParameterSpec("SHA-256", "MGF1", MGF1ParameterSpec.SHA256,
java.mgf1 · CWE-327
AES-128-GCM Reduced margin 1 place See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:63 key: "http://www.w3.org/2009/xmlenc11#aes128-gcm",
xmldsig.algorithm · CWE-327
AES-128-KW Reduced margin 1 place See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

code.algorithm-constant
AES-192-CBC Reduced margin 1 place See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:71 key: "http://www.w3.org/2001/04/xmlenc#aes192-cbc",
xmldsig.algorithm · CWE-327
AES-192-GCM Reduced margin 1 place See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:59 key: "http://www.w3.org/2009/xmlenc11#aes192-gcm",
xmldsig.algorithm · CWE-327
AES-192-KW Reduced margin 1 place See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

code.algorithm-constant
Kerberos Reduced margin 1 place See details

Algorithm named by its object identifier

A quoted OID from the algorithm registries: `'1.2.840.113549.1.1.11'` (sha256WithRSA), `'2.16.840.1.101.3.4.2.1'` (SHA-256), `'1.2.840.10045.3.1.7'` (P-256), `'1.2.156.10197.1.301'` (SM2). Code that builds or parses ASN.1 - PDF and CMS signing, certificate handling, PKCS#11 - names its algorithms this way, and an OID is exact.

This line names an algorithm by its registered number.

What to do. The migration belongs to the operation the OID selects; the table it sits in is usually where a post-quantum OID gets added.

  1. common/src/main/java/org/keycloak/common/constants/KerberosConstants.java:44 private static final String KRB5_OID_STR = "1.2.840.113554.1.2.2";
code.oid
PBKDF2 Reduced margin 1 place See details

Key material constructed for a named algorithm

`new SecretKeySpec(bytes, "AES")` and the other key-spec constructors name the algorithm as an argument rather than through `getInstance()`. Code that wraps raw bytes into a key this way often never calls `getInstance()` at all, so the algorithm is invisible to a scan that only looks at the factories.

This wraps raw bytes into a key for a named algorithm. It is part of the same migration as whatever uses that key.

What to do. Wherever this key is used, the same migration applies as to the call that consumes it. Trace it to the operation and treat the two together.

  1. server-spi-private/src/main/java/org/keycloak/credential/hash/Pbkdf2PasswordHashProvider.java:114 KeySpec spec = new PBEKeySpec(rawPasswordWithPadding.toCharArray(), salt, iterations, derivedKeySize);
java.keyspec · CWE-327
SPNEGO Reduced margin 1 place See details

Algorithm named by its object identifier

A quoted OID from the algorithm registries: `'1.2.840.113549.1.1.11'` (sha256WithRSA), `'2.16.840.1.101.3.4.2.1'` (SHA-256), `'1.2.840.10045.3.1.7'` (P-256), `'1.2.156.10197.1.301'` (SM2). Code that builds or parses ASN.1 - PDF and CMS signing, certificate handling, PKCS#11 - names its algorithms this way, and an OID is exact.

This line names an algorithm by its registered number.

What to do. The migration belongs to the operation the OID selects; the table it sits in is usually where a post-quantum OID gets added.

  1. common/src/main/java/org/keycloak/common/constants/KerberosConstants.java:37 private static final String SPNEGO_OID_STR = "1.3.6.1.5.5.2";
code.oid
AES-128-KW Reduced margin 25 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Grover's algorithm halves the effective strength; the parameter, not the design, is the problem.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. common/src/main/java/org/keycloak/common/crypto/CryptoConstants.java:9 public static final String A128KW = "A128KW";
  2. common/src/main/java/org/keycloak/common/crypto/CryptoConstants.java:14 public static final String ECDH_ES_A128KW = "ECDH-ES+A128KW";
  3. core/src/main/java/org/keycloak/crypto/Algorithm.java:54 String ECDH_ES_A128KW = CryptoConstants.ECDH_ES_A128KW;
  4. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:28 public static final String A128KW = CryptoConstants.A128KW;
  5. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:33 public static final String ECDH_ES_A128KW = CryptoConstants.ECDH_ES_A128KW;
  6. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:222 if (Algorithm.ECDH_ES_A128KW.equals(alg) || Algorithm.ECDH_ES_A192KW.equals(alg)
  7. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:246 if (Algorithm.ECDH_ES_A128KW.equals(alg)) {
  8. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:59 providers.put(CryptoConstants.A128KW, new AesKeyWrapAlgorithmProvider());
  9. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:64 providers.put(CryptoConstants.ECDH_ES_A128KW, new BCEcdhEsAlgorithmProvider());
  10. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:190 if (Algorithm.ECDH_ES_A128KW.equals(alg) || Algorithm.ECDH_ES_A192KW.equals(alg)
  11. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:201 if (Algorithm.ECDH_ES_A128KW.equals(alg)) {
  12. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:242 if (Algorithm.ECDH_ES_A128KW.equals(alg)) {
  13. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:60 providers.put(CryptoConstants.A128KW, new AesKeyWrapAlgorithmProvider());
  14. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:65 providers.put(CryptoConstants.ECDH_ES_A128KW, new ElytronEcdhEsAlgorithmProvider());
  15. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:220 if (Algorithm.ECDH_ES_A128KW.equals(alg) || Algorithm.ECDH_ES_A192KW.equals(alg)
  16. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:231 if (Algorithm.ECDH_ES_A128KW.equals(alg)) {
  17. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:94 providers.put(CryptoConstants.A128KW, new FIPSAesKeyWrapAlgorithmProvider());
  18. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:99 providers.put(CryptoConstants.ECDH_ES_A128KW, new BCFIPSEcdhEsAlgorithmProvider());
  19. services/src/main/java/org/keycloak/crypto/EcdhEsA128KwCekManagementProviderFactory.java:25 public static final String ID = JWEConstants.ECDH_ES_A128KW;
  20. services/src/main/java/org/keycloak/crypto/EcdhEsCekManagementProvider.java:37 if (JWEConstants.ECDH_ES.equals(jweAlgorithmName) || JWEConstants.ECDH_ES_A128KW.equals(jweAlgorithmName)
  21. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:49 Algorithm.ECDH_ES, Algorithm.ECDH_ES_A128KW, Algorithm.ECDH_ES_A192KW, Algorithm.ECDH_ES_A256KW);
  22. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:65 return Algorithm.ECDH_ES_A128KW;
  23. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:77 case Algorithm.ECDH_ES_A128KW :
  24. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:148 return (algorithm.equals(Algorithm.ECDH_ES) || algorithm.equals(Algorithm.ECDH_ES_A128KW)
  25. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:113 case Algorithm.ECDH_ES, Algorithm.ECDH_ES_A128KW, Algorithm.ECDH_ES_A192KW, Algorithm.ECDH_ES_A256KW ->
jose.algorithm · CWE-327
AES-192-KW Reduced margin 20 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Grover's algorithm halves the effective strength; the parameter, not the design, is the problem.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. common/src/main/java/org/keycloak/common/crypto/CryptoConstants.java:15 public static final String ECDH_ES_A192KW = "ECDH-ES+A192KW";
  2. core/src/main/java/org/keycloak/crypto/Algorithm.java:55 String ECDH_ES_A192KW = CryptoConstants.ECDH_ES_A192KW;
  3. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:34 public static final String ECDH_ES_A192KW = CryptoConstants.ECDH_ES_A192KW;
  4. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:222 if (Algorithm.ECDH_ES_A128KW.equals(alg) || Algorithm.ECDH_ES_A192KW.equals(alg)
  5. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:248 } else if (Algorithm.ECDH_ES_A192KW.equals(alg)) {
  6. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:65 providers.put(CryptoConstants.ECDH_ES_A192KW, new BCEcdhEsAlgorithmProvider());
  7. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:190 if (Algorithm.ECDH_ES_A128KW.equals(alg) || Algorithm.ECDH_ES_A192KW.equals(alg)
  8. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:203 } else if (Algorithm.ECDH_ES_A192KW.equals(alg)) {
  9. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:244 } else if (Algorithm.ECDH_ES_A192KW.equals(alg)) {
  10. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:66 providers.put(CryptoConstants.ECDH_ES_A192KW, new ElytronEcdhEsAlgorithmProvider());
  11. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:220 if (Algorithm.ECDH_ES_A128KW.equals(alg) || Algorithm.ECDH_ES_A192KW.equals(alg)
  12. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:233 } else if (Algorithm.ECDH_ES_A192KW.equals(alg)) {
  13. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:100 providers.put(CryptoConstants.ECDH_ES_A192KW, new BCFIPSEcdhEsAlgorithmProvider());
  14. services/src/main/java/org/keycloak/crypto/EcdhEsA192KwCekManagementProviderFactory.java:25 public static final String ID = JWEConstants.ECDH_ES_A192KW;
  15. services/src/main/java/org/keycloak/crypto/EcdhEsCekManagementProvider.java:38 || JWEConstants.ECDH_ES_A192KW.equals(jweAlgorithmName)
  16. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:49 Algorithm.ECDH_ES, Algorithm.ECDH_ES_A128KW, Algorithm.ECDH_ES_A192KW, Algorithm.ECDH_ES_A256KW);
  17. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:67 return Algorithm.ECDH_ES_A192KW;
  18. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:79 case Algorithm.ECDH_ES_A192KW :
  19. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:149 || algorithm.equals(Algorithm.ECDH_ES_A192KW) || algorithm.equals(Algorithm.ECDH_ES_A256KW));
  20. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:113 case Algorithm.ECDH_ES, Algorithm.ECDH_ES_A128KW, Algorithm.ECDH_ES_A192KW, Algorithm.ECDH_ES_A256KW ->
jose.algorithm · CWE-327
AES-128-CBC Reduced margin 8 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Grover's algorithm halves the effective strength; the parameter, not the design, is the problem.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/jose/jwe/enc/AesCbcHmacShaJWEEncryptionProvider.java:31 if (JWEConstants.A128CBC_HS256.equals(jwaAlgorithmName)) {
  2. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:37 public static final String A128CBC_HS256 = "A128CBC-HS256";
  3. core/src/main/java/org/keycloak/jose/jwe/JWERegistry.java:44 ENC_PROVIDERS.put(JWEConstants.A128CBC_HS256, new AesCbcHmacShaEncryptionProvider.Aes128CbcHmacSha256Provider());
  4. core/src/main/java/org/keycloak/util/TokenUtil.java:225 case 16: encAlgorithm = hmacKey != null ? JWEConstants.A128CBC_HS256 : JWEConstants.A128GCM;
  5. services/src/main/java/org/keycloak/crypto/Aes128CbcHmacSha256ContentEncryptionProviderFactory.java:24 public static final String ID = JWEConstants.A128CBC_HS256;
  6. services/src/main/java/org/keycloak/jose/jws/DefaultTokenManager.java:332 return getEncryptAlgorithm(OIDCConfigAttributes.ID_TOKEN_ENCRYPTED_RESPONSE_ENC, JWEConstants.A128CBC_HS256);
  7. services/src/main/java/org/keycloak/jose/jws/DefaultTokenManager.java:334 return JWEConstants.A128CBC_HS256;
  8. services/src/main/java/org/keycloak/jose/jws/DefaultTokenManager.java:340 return getEncryptAlgorithm(OIDCConfigAttributes.USER_INFO_ENCRYPTED_RESPONSE_ENC, JWEConstants.A128CBC_HS256);
jose.algorithm · CWE-327
AES-KW Reduced margin 8 places See details

Symmetric cipher through BouncyCastle

A BouncyCastle symmetric engine or mode. Symmetric encryption is not broken by a quantum computer, so these are inventoried rather than flagged - but a complete cryptographic inventory has to contain them, and the mode is where AES-256 or a 64-bit block shows up.

This is the kind of encryption that quantum computers do not break. It is listed so the inventory is complete.

What to do. Use a 256-bit key. No change of algorithm is required unless the engine is DES, RC4 or Blowfish.

java.bouncycastle.symmetric
AES-128-GCM Reduced margin 6 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Grover's algorithm halves the effective strength; the parameter, not the design, is the problem.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/jose/jwe/enc/AesGcmJWEEncryptionProvider.java:29 if (JWEConstants.A128GCM.equals(jwaAlgorithmName)) {
  2. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:40 public static final String A128GCM = "A128GCM";
  3. core/src/main/java/org/keycloak/jose/jwe/JWERegistry.java:41 ENC_PROVIDERS.put(JWEConstants.A128GCM, new AesGcmJWEEncryptionProvider(JWEConstants.A128GCM));
  4. core/src/main/java/org/keycloak/util/TokenUtil.java:225 case 16: encAlgorithm = hmacKey != null ? JWEConstants.A128CBC_HS256 : JWEConstants.A128GCM;
  5. services/src/main/java/org/keycloak/broker/oid4vp/ResponseEncryption.java:41 List.of(JWEConstants.A128GCM, JWEConstants.A256GCM);
  6. services/src/main/java/org/keycloak/crypto/Aes128GcmContentEncryptionProviderFactory.java:24 public static final String ID = JWEConstants.A128GCM;
jose.algorithm · CWE-327
AES-192-CBC Reduced margin 5 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Grover's algorithm halves the effective strength; the parameter, not the design, is the problem.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/jose/jwe/enc/AesCbcHmacShaJWEEncryptionProvider.java:36 } else if (JWEConstants.A192CBC_HS384.equals(jwaAlgorithmName)) {
  2. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:38 public static final String A192CBC_HS384 = "A192CBC-HS384";
  3. core/src/main/java/org/keycloak/jose/jwe/JWERegistry.java:45 ENC_PROVIDERS.put(JWEConstants.A192CBC_HS384, new AesCbcHmacShaEncryptionProvider.Aes192CbcHmacSha384Provider());
  4. core/src/main/java/org/keycloak/util/TokenUtil.java:227 case 24: encAlgorithm = hmacKey != null ? JWEConstants.A192CBC_HS384 : JWEConstants.A192GCM;
  5. services/src/main/java/org/keycloak/crypto/Aes192CbcHmacSha384ContentEncryptionProviderFactory.java:24 public static final String ID = JWEConstants.A192CBC_HS384;
jose.algorithm · CWE-327
AES-192-GCM Reduced margin 5 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Grover's algorithm halves the effective strength; the parameter, not the design, is the problem.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/jose/jwe/enc/AesGcmJWEEncryptionProvider.java:32 } else if (JWEConstants.A192GCM.equals(jwaAlgorithmName)) {
  2. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:41 public static final String A192GCM = "A192GCM";
  3. core/src/main/java/org/keycloak/jose/jwe/JWERegistry.java:42 ENC_PROVIDERS.put(JWEConstants.A192GCM, new AesGcmJWEEncryptionProvider(JWEConstants.A192GCM));
  4. core/src/main/java/org/keycloak/util/TokenUtil.java:227 case 24: encAlgorithm = hmacKey != null ? JWEConstants.A192CBC_HS384 : JWEConstants.A192GCM;
  5. services/src/main/java/org/keycloak/crypto/Aes192GcmContentEncryptionProviderFactory.java:24 public static final String ID = JWEConstants.A192GCM;
jose.algorithm · CWE-327
PBKDF2-HMAC-SHA1 Reduced margin 2 places See details

Password hashing or key derivation

A `SecretKeyFactory` for PBKDF2, or a BouncyCastle password KDF. Not a quantum exposure, and part of a complete inventory.

This is how passwords are stored. Quantum computers do not meaningfully weaken it.

What to do. PBKDF2 needs a high iteration count. Argon2 through BouncyCastle is stronger.

  1. server-spi-private/src/main/java/org/keycloak/credential/hash/Pbkdf2PasswordHashProviderFactory.java:37 public static final String PBKDF2_ALGORITHM = "PBKDF2WithHmacSHA1";
  2. server-spi-private/src/main/java/org/keycloak/credential/hash/Pbkdf2PasswordHashProviderFactory.java:52 return new Pbkdf2PasswordHashProvider(ID, PBKDF2_ALGORITHM, DEFAULT_ITERATIONS, getMaxPaddingLength());
java.kdf
PBKDF2-HMAC-SHA256 Reduced margin 2 places See details

Password hashing or key derivation

A `SecretKeyFactory` for PBKDF2, or a BouncyCastle password KDF. Not a quantum exposure, and part of a complete inventory.

This is how passwords are stored. Quantum computers do not meaningfully weaken it.

What to do. PBKDF2 needs a high iteration count. Argon2 through BouncyCastle is stronger.

  1. server-spi-private/src/main/java/org/keycloak/credential/hash/Pbkdf2Sha256PasswordHashProviderFactory.java:14 public static final String PBKDF2_ALGORITHM = "PBKDF2WithHmacSHA256";
  2. server-spi-private/src/main/java/org/keycloak/credential/hash/Pbkdf2Sha256PasswordHashProviderFactory.java:23 return new Pbkdf2PasswordHashProvider(ID, PBKDF2_ALGORITHM, DEFAULT_ITERATIONS, getMaxPaddingLength(), 256);
java.kdf
PBKDF2-HMAC-SHA512 Reduced margin 2 places See details

Password hashing or key derivation

A `SecretKeyFactory` for PBKDF2, or a BouncyCastle password KDF. Not a quantum exposure, and part of a complete inventory.

This is how passwords are stored. Quantum computers do not meaningfully weaken it.

What to do. PBKDF2 needs a high iteration count. Argon2 through BouncyCastle is stronger.

  1. server-spi-private/src/main/java/org/keycloak/credential/hash/Pbkdf2Sha512PasswordHashProviderFactory.java:14 public static final String PBKDF2_ALGORITHM = "PBKDF2WithHmacSHA512";
  2. server-spi-private/src/main/java/org/keycloak/credential/hash/Pbkdf2Sha512PasswordHashProviderFactory.java:23 return new Pbkdf2PasswordHashProvider(ID, PBKDF2_ALGORITHM, DEFAULT_ITERATIONS, getMaxPaddingLength());
java.kdf
SHA-256 Reduced margin 1 place See details

Digest through BouncyCastle

A BouncyCastle digest class. The digest name is read from the class, so `MD5Digest` and `SHA512Digest` are the same rule with opposite conclusions.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Pre-image resistance falls to about 128 bits of quantum work. Adequate for most uses; SHA-384 restores the full margin where a signature must last decades.

What to do. SHA-256 as the floor, SHA-384 where the digest protects something long-lived. MD5 and SHA-1 need replacing now.

  1. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:157 ConcatenationKDFGenerator concatKdf = new ConcatenationKDFGenerator(DigestFactory.createSHA256());
java.bouncycastle.digest · CWE-328
SHA-256 Reduced margin 1 place See details

Hash function in use

`createHash()` or `subtle.digest()`. The digest is read from the argument, so one rule covers the family: MD5 and SHA-1 are reported as broken, SHA-256 as a reduced margin, SHA-384 and above as inventory.

A quantum computer weakens this but does not break it. Increasing the key or digest size restores the margin. Pre-image resistance falls to about 128 bits of quantum work. Adequate for most uses; SHA-384 restores the full margin where a signature must last decades.

What to do. SHA-256 as the floor, SHA-384 where the digest protects something long-lived.

js.hash · CWE-328
X.509 Could not be determined 30 places See details

X.509 certificate handled in code

A certificate, signing request or revocation list loaded, parsed or created: `x509.load_pem_x509_certificate()`, `x509.ParseCertificate()`, `CertificateFactory.generateCertificate()`, `new X509Certificate()`. Certificates are the longest-lived cryptographic artefacts most systems own.

This code reads or builds a digital identity document. Its key, and how long it stays valid, decide when it has to be replaced.

What to do. Shorten certificate lifetimes now, so re-issuing with a post-quantum key is routine rather than an incident.

  1. adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/PemUtils.java:150 CertificateFactory cf = CertificateFactory.getInstance("X.509", CryptoConstants.BC_PROVIDER_ID);
  2. adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/PemUtils.java:151 X509Certificate cert = (X509Certificate) cf.generateCertificate(is);
  3. common/src/main/java/org/keycloak/common/util/DerUtils.java:81 X509Certificate cert = (X509Certificate) cf.generateCertificate(is);
  4. core/src/main/java/org/keycloak/crypto/X509CertificateChainValidator.java:107 certificates.add((X509Certificate) certificateFactory.generateCertificate(input));
  5. core/src/main/java/org/keycloak/mdoc/MdocIssuerSignedDocument.java:152 return (X509Certificate) CertificateFactory.getInstance("X.509")
  6. core/src/main/java/org/keycloak/mdoc/MdocIssuerSignedDocument.java:153 .generateCertificate(new ByteArrayInputStream(encoded));
  7. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:148 return new JcaX509CertificateConverter().setProvider(BouncyIntegration.PROVIDER).getCertificate(certGen.build(sigGen));
  8. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:183 return new JcaX509CertificateConverter().getCertificate(holder);
  9. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:319 X509Certificate x509Certificate = new JcaX509CertificateConverter()
  10. crypto/default/src/main/java/org/keycloak/crypto/def/BCOCSPProvider.java:224 X509Certificate tempCert = new JcaX509CertificateConverter()
  11. crypto/default/src/main/java/org/keycloak/crypto/def/BCOCSPProvider.java:242 X509Certificate tempCert = new JcaX509CertificateConverter()
  12. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:167 return CertificateFactory.getInstance("X.509", BouncyIntegration.PROVIDER);
  13. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronOCSPProvider.java:85 CertificateFactory cf = CertificateFactory.getInstance("X.509");
  14. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronOCSPProvider.java:94 CertPath cp = cf.generateCertPath(Arrays.asList(certs));
  15. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:163 return CertificateFactory.getInstance("X.509");
  16. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:148 return new JcaX509CertificateConverter().setProvider(BouncyIntegration.PROVIDER).getCertificate(certGen.build(sigGen));
  17. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:185 return new JcaX509CertificateConverter().getCertificate(holder);
  18. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:322 X509Certificate x509Certificate = new JcaX509CertificateConverter()
  19. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSOCSPProvider.java:223 X509Certificate tempCert = new JcaX509CertificateConverter()
  20. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSOCSPProvider.java:241 X509Certificate tempCert = new JcaX509CertificateConverter()
  21. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:228 return CertificateFactory.getInstance("X.509", BouncyIntegration.PROVIDER);
  22. operator/src/main/java/org/keycloak/operator/controllers/KeycloakClientBaseController.java:365 CertificateFactory cf = CertificateFactory.getInstance("X.509");
  23. operator/src/main/java/org/keycloak/operator/controllers/KeycloakClientBaseController.java:366 X509Certificate cert = (X509Certificate) cf.generateCertificate(new ByteArrayInputStream(certBytes));
  24. saml-core/src/main/java/org/keycloak/saml/processing/core/util/XMLSignatureUtil.java:651 CertificateFactory cf = CertificateFactory.getInstance("X.509");
  25. saml-core/src/main/java/org/keycloak/saml/processing/core/util/XMLSignatureUtil.java:655 cert = (X509Certificate) cf.generateCertificate(bais);
  26. services/src/main/java/org/keycloak/authentication/authenticators/x509/CertificateValidator.java:372 CertificateFactory cf = CertificateFactory.getInstance("X.509");
  27. services/src/main/java/org/keycloak/authentication/authenticators/x509/CertificateValidator.java:482 return (X509CRL) cf.generateCRL(is);
  28. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProviderFactory.java:184 CertPath certPath = CertificateFactory.getInstance("X.509").generateCertPath(certificates);
  29. services/src/main/java/org/keycloak/truststore/TruststoreBuilder.java:272 CertificateFactory certFactory = CertificateFactory.getInstance("X509");
  30. services/src/main/java/org/keycloak/truststore/TruststoreBuilder.java:275 certs = certFactory.generateCertificates(pemInputStream);
x509.certificate
unknown Could not be determined 30 places See details

Algorithm chosen at runtime

`KeyPairGenerator.getInstance(x)`, `Mac.getInstance(lookup(key))` and the other JCA factories, where the argument is a variable or a call. The algorithm cannot be resolved without running the program, so this is reported as an unknown rather than assumed to be classical; what the factory does - sign, tag, digest - is still reported, and so are the lines that use the object.

This code picks its encryption method while it runs, so a scan cannot tell which one it ends up using. Somebody has to check the configuration.

What to do. Trace the value to its configuration source and record the concrete algorithm in the cryptographic inventory by hand.

  1. common/src/main/java/org/keycloak/common/crypto/PemUtilsProvider.java:150 return MessageDigest.getInstance(encoding).digest(pemToDer(certChain[0]));
  2. common/src/main/java/org/keycloak/common/util/KeyUtils.java:79 KeyPairGenerator keyGen = KeyPairGenerator.getInstance(curveName);
  3. common/src/main/java/org/keycloak/common/util/KeyUtils.java:80 return keyGen.generateKeyPair();
  4. core/src/main/java/org/keycloak/crypto/AsymmetricSignatureSignerContext.java:51 Signature signature = Signature.getInstance(JavaAlgorithm.getJavaAlgorithm(key.getAlgorithmOrDefault(), key.getCurve()));
  5. core/src/main/java/org/keycloak/crypto/AsymmetricSignatureSignerContext.java:54 return signature.sign();
  6. core/src/main/java/org/keycloak/crypto/AsymmetricSignatureVerifierContext.java:51 return verifier.verify(signature);
  7. core/src/main/java/org/keycloak/crypto/AsymmetricSignatureVerifierContext.java:60 return Signature.getInstance(JavaAlgorithm.getJavaAlgorithm(key.getAlgorithmOrDefault(), key.getCurve()));
  8. core/src/main/java/org/keycloak/crypto/MacSignatureSignerContext.java:47 Mac mac = Mac.getInstance(JavaAlgorithm.getJavaAlgorithm(key.getAlgorithmOrDefault()));
  9. core/src/main/java/org/keycloak/crypto/MacSignatureSignerContext.java:50 return mac.doFinal();
  10. core/src/main/java/org/keycloak/crypto/MacSignatureVerifierContext.java:45 Mac mac = Mac.getInstance(JavaAlgorithm.getJavaAlgorithm(key.getAlgorithmOrDefault()));
  11. core/src/main/java/org/keycloak/crypto/MacSignatureVerifierContext.java:48 byte[] verificationSignature = mac.doFinal();
  12. core/src/main/java/org/keycloak/jose/jwk/AKPUtils.java:32 KeyFactory keyFactory = KeyFactory.getInstance(algorithm);
  13. core/src/main/java/org/keycloak/jose/jwk/EdECUtilsImpl.java:108 publicKey = KeyFactory.getInstance(crv).generatePublic(keySpec);
  14. core/src/main/java/org/keycloak/jose/jws/crypto/HashUtils.java:59 MessageDigest md = MessageDigest.getInstance(javaAlgorithmName);
  15. core/src/main/java/org/keycloak/jose/jws/crypto/HashUtils.java:61 return md.digest();
  16. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:131 return KeyPairGenerator.getInstance(algorithm, BouncyIntegration.PROVIDER);
  17. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:137 return KeyFactory.getInstance(algorithm, BouncyIntegration.PROVIDER);
  18. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:153 return SecretKeyFactory.getInstance(keyAlgorithm, BouncyIntegration.PROVIDER);
  19. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:185 return Signature.getInstance(JavaAlgorithm.getJavaAlgorithm(sigAlgName), BouncyIntegration.PROVIDER);
  20. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:128 return KeyPairGenerator.getInstance(algorithm);
  21. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:138 return KeyFactory.getInstance(algorithm);
  22. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:153 return SecretKeyFactory.getInstance(keyAlgorithm);
  23. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:200 return Signature.getInstance(javaAlgorithm);
  24. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:198 return KeyPairGenerator.getInstance(algorithm, BouncyIntegration.PROVIDER);
  25. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:203 return KeyFactory.getInstance(algorithm , BouncyIntegration.PROVIDER);
  26. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:218 return SecretKeyFactory.getInstance(keyAlgorithm, BouncyIntegration.PROVIDER);
  27. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:245 return Signature.getInstance(JavaAlgorithm.getJavaAlgorithm(sigAlgName), BouncyIntegration.PROVIDER);
  28. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:87 return Signature.getInstance(javaSignatureAlgorithm);
  29. server-spi-private/src/main/java/org/keycloak/models/utils/SHAPasswordEncoder.java:48 byte[] digest = messageDigest.digest(rawPassword.getBytes(StandardCharsets.UTF_8));
  30. server-spi-private/src/main/java/org/keycloak/models/utils/SHAPasswordEncoder.java:60 return MessageDigest.getInstance(algorithm);
java.keypairgenerator.variable · CWE-327
X.509 Could not be determined 25 places See details

Certificate signed or verified

A certificate or signing request is signed - `x509.CreateCertificate()`, a pyca `builder.sign()`, a Bouncy Castle `certBuilder.build(signer)` - or its signature or chain is checked: `CheckSignature()`, `Verify(x509.VerifyOptions{})`, `CertPathValidator`, `is_signature_valid`. The algorithm is the signing key's.

This code puts a signature on a digital identity document, or checks one.

What to do. Find the key behind the signature. Issuing certificates is where an ML-DSA key eventually goes, and the relying parties that verify them have to accept it first.

  1. common/src/main/java/org/keycloak/common/util/CertificateUtils.java:100 certificate.verify(certificate.getPublicKey());
  2. core/src/main/java/org/keycloak/crypto/X509CertificateChainValidator.java:132 leaf.verify(leaf.getPublicKey());
  3. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:148 return new JcaX509CertificateConverter().setProvider(BouncyIntegration.PROVIDER).getCertificate(certGen.build(sigGen));
  4. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:181 X509CertificateHolder holder = builder.build(createSigner(caKeyPair.getPrivate()));
  5. crypto/default/src/main/java/org/keycloak/crypto/def/BCOCSPProvider.java:318 signingCert.verify(issuerCertificate.getPublicKey());
  6. crypto/default/src/main/java/org/keycloak/crypto/def/BCOCSPProvider.java:367 return basicOcspResponse.isSignatureValid(contentVerifier);
  7. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:180 return CertPathBuilder.getInstance("PKIX", BouncyIntegration.PROVIDER);
  8. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronOCSPProvider.java:84 CertPathBuilder cpb = CertPathBuilder.getInstance("PKIX");
  9. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronOCSPProvider.java:86 CertPathValidator cpv = CertPathValidator.getInstance("PKIX");
  10. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronOCSPProvider.java:104 PKIXCertPathValidatorResult result = (PKIXCertPathValidatorResult) cpv.validate(cp, params);
  11. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:175 return CertPathBuilder.getInstance("PKIX");
  12. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:148 return new JcaX509CertificateConverter().setProvider(BouncyIntegration.PROVIDER).getCertificate(certGen.build(sigGen));
  13. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:183 X509CertificateHolder holder = builder.build(createSigner(caKeyPair.getPrivate()));
  14. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSOCSPProvider.java:317 signingCert.verify(issuerCertificate.getPublicKey());
  15. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSOCSPProvider.java:366 return basicOcspResponse.isSignatureValid(contentVerifier);
  16. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:240 return CertPathBuilder.getInstance("PKIX", BouncyIntegration.PROVIDER);
  17. model/infinispan/src/main/java/org/keycloak/jgroups/certificates/Utils.java:87 var tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
  18. operator/src/main/java/org/keycloak/operator/controllers/KeycloakClientBaseController.java:367 TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
  19. server-spi-private/src/main/java/org/keycloak/broker/provider/X509TrustMaterial.java:58 certificate.verify(certificate.getPublicKey());
  20. services/src/main/java/org/keycloak/authentication/authenticators/x509/CertificateValidator.java:803 cert.verify(cacert.getPublicKey());
  21. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProviderFactory.java:185 CertPathValidator validator = CertPathValidator.getInstance(CertPathValidator.getDefaultType());
  22. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProviderFactory.java:187 validator.validate(certPath, params);
  23. services/src/main/java/org/keycloak/truststore/JSSETruststoreConfigurator.java:81 tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
  24. services/src/main/java/org/keycloak/utils/CRLUtils.java:79 crl.verify(crlSignatureCertificate.getPublicKey());
  25. services/src/main/java/org/keycloak/utils/CRLUtils.java:110 crl.verify(cacert.getPublicKey());
x509.signature
KeyStore Could not be determined 12 places See details

Key store holding classical key material

`KeyStore.getInstance("JKS"|"PKCS12"|"BCFKS")`. The store format itself is not the issue; it is the inventory point where the classical private keys of this application live.

This is the application's key cupboard. It is worth knowing what is in it before planning any replacement.

What to do. Record which keys this store holds. A key store is where a migration either happens or silently does not.

  1. adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/parsers/DeploymentBuilder.java:284 keyStore = KeyStore.getInstance(type);
  2. authz/client/src/main/java/org/keycloak/authorization/client/util/crypto/AuthzClientCryptoProvider.java:64 return KeyStore.getInstance(KeyStore.getDefaultType()).getProvider();
  3. authz/client/src/main/java/org/keycloak/authorization/client/util/crypto/AuthzClientCryptoProvider.java:200 return KeyStore.getInstance(format.name());
  4. common/src/main/java/org/keycloak/common/util/KeystoreUtil.java:101 KeyStore trustStore = KeyStore.getInstance(keystoreType);
  5. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:159 return KeyStore.getInstance(format.toString());
  6. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:161 return KeyStore.getInstance(format.toString(), BouncyIntegration.PROVIDER);
  7. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronOCSPProvider.java:80 KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
  8. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:158 return KeyStore.getInstance(format.toString());
  9. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:223 return KeyStore.getInstance(format.toString(), BouncyIntegration.PROVIDER);
  10. operator/src/main/java/org/keycloak/operator/controllers/KeycloakClientBaseController.java:368 KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
  11. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:143 KeyStore keyStore = KeyStore.getInstance(keystoreType);
  12. services/src/main/java/org/keycloak/vault/FilesKeystoreVaultProvider.java:54 ks = KeyStore.getInstance(keystoreType);
java.keystore
unknown Could not be determined Renamed import 12 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

The algorithm could not be established from the source. Usually it is selected while the program runs, but it may equally be that the call gives no clue, or that it is decided somewhere this scan does not reach. Somebody has to check.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. federation/ldap/src/main/java/org/keycloak/services/managers/LDAPServerCapabilitiesManager.java:69 if (config.getComponentId() != null && !LDAPConstants.AUTH_TYPE_NONE.equals(config.getAuthType())
  2. federation/ldap/src/main/java/org/keycloak/services/managers/LDAPServerCapabilitiesManager.java:182 config.setAuthType(LDAPConstants.AUTH_TYPE_NONE);
  3. federation/ldap/src/main/java/org/keycloak/storage/ldap/idm/store/ldap/LDAPContextManager.java:181 if (!LDAPConstants.AUTH_TYPE_NONE.equals(authType)) {
  4. federation/ldap/src/main/java/org/keycloak/storage/ldap/idm/store/ldap/LDAPContextManager.java:202 if (!LDAPConstants.AUTH_TYPE_NONE.equals(authType)) {
  5. federation/ldap/src/main/java/org/keycloak/storage/ldap/LDAPStorageProviderFactory.java:360 boolean bothAnonymous = LDAPConstants.AUTH_TYPE_NONE.equals(cfg.getAuthType())
  6. federation/ldap/src/main/java/org/keycloak/storage/ldap/LDAPStorageProviderFactory.java:361 && LDAPConstants.AUTH_TYPE_NONE.equals(oldCfg.getAuthType());
  7. quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/BootstrapAdmin.java:34 @Option(arity = "0", paramLabel = Picocli.NO_PARAM_LABEL, names = { "--no-prompt" }, description = "Run non-interactive without prompting", scope = ScopeType.INHERIT)
  8. quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/OptionRenderer.java:70 if (StringUtil.isNotBlank(paramLabel) && !NO_PARAM_LABEL.equals(paramLabel) && !option.usageHelp() && !option.versionHelp()) {
  9. quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/OptionRenderer.java:80 if (label.startsWith("<") || NO_PARAM_LABEL.equals(label)) {
  10. services/src/main/java/org/keycloak/authentication/authenticators/conditional/ConditionalCredentialAuthenticator.java:54 authCredentials = Collections.singletonList(ConditionalCredentialAuthenticatorFactory.NONE_CREDENTIAL);
  11. services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java:436 boolean isPassive = TokenUtil.hasPrompt(request.getPrompt(), OIDCLoginProtocol.PROMPT_VALUE_NONE);
  12. services/src/main/java/org/keycloak/protocol/oidc/OIDCWellKnownProvider.java:96 public static final List<String> DEFAULT_PROMPT_VALUES_SUPPORTED = list(OIDCLoginProtocol.PROMPT_VALUE_NONE /*, OIDCLoginProtocol.PROMPT_VALUE_CREATE*/, OIDCLoginProtocol.PROMPT_VALUE_LOGIN, OIDCLoginProtocol.PROMPT_VALUE_CONSENT);
jose.algorithm · CWE-327
X.509 Could not be determined 5 places See details

Certificate verification disabled

TLS certificate or host-name verification switched off: `InsecureSkipVerify: true`, `rejectUnauthorized: false`, `verify=False`, `ssl.CERT_NONE`, `NoopHostnameVerifier`, `TrustAllStrategy`. Any key exchange is worthless when the peer is not authenticated, post-quantum or not.

This connection accepts any certificate, so it cannot tell the real server from an impostor.

What to do. Verify certificates. Pin a private CA through a trust store instead of switching verification off.

  1. integration/client-cli/admin-cli/src/main/java/org/keycloak/client/cli/util/HttpUtil.java:276 .loadTrustMaterial(file, password == null ? null : password.toCharArray(), TrustSelfSignedStrategy.INSTANCE)
  2. integration/client-cli/admin-cli/src/main/java/org/keycloak/client/cli/util/HttpUtil.java:292 builder.loadTrustMaterial(null, new TrustSelfSignedStrategy());
  3. operator/src/main/java/org/keycloak/operator/controllers/KeycloakClientBaseController.java:382 clientBuilder.hostnameVerifier(NoopHostnameVerifier.INSTANCE);
  4. services/src/main/java/org/keycloak/connections/httpclient/HttpClientBuilder.java:255 verifier = new NoopHostnameVerifier();
  5. services/src/main/java/org/keycloak/connections/httpclient/HttpClientBuilder.java:274 verifier = new NoopHostnameVerifier();
x509.verification-disabled · CWE-295
unknown Could not be determined 1 place See details

Mask-generation digest named for RSA padding

`MGF1ParameterSpec.SHA256` names the digest inside RSA-OAEP and RSA-PSS padding. It is a separate choice from the digest the signature or the cipher uses, it is frequently left at SHA-1 by default, and a static import of it - `import static java.security.spec.MGF1ParameterSpec.SHA512` - is the only place the choice appears in the file that makes it.

This picks the hash used inside RSA padding. It matters because the default is often SHA-1, which is broken today without any quantum computer.

What to do. The mask-generation digest travels with the RSA key it pads. When that key moves to ML-KEM or ML-DSA the padding goes with it; until then, SHA-256 or better.

  1. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:187 MGF1ParameterSpec ps = new MGF1ParameterSpec("SHA-" + digestLength);
java.mgf1 · CWE-327
unknown Could not be determined 1 place See details

Key material constructed for a named algorithm

`new SecretKeySpec(bytes, "AES")` and the other key-spec constructors name the algorithm as an argument rather than through `getInstance()`. Code that wraps raw bytes into a key this way often never calls `getInstance()` at all, so the algorithm is invisible to a scan that only looks at the factories.

This wraps raw bytes into a key for a named algorithm. It is part of the same migration as whatever uses that key.

What to do. Wherever this key is used, the same migration applies as to the call that consumes it. Trace it to the operation and treat the two together.

  1. server-spi/src/main/java/org/keycloak/models/utils/HmacOTP.java:161 SecretKeySpec macKey = new SecretKeySpec(keyBytes, "RAW");
java.keyspec · CWE-327
unknown Could not be determined 1 place See details

Non-cryptographic randomness near key material

`new Random()` or `Math.random()` in a file that also imports `java.security`, `javax.crypto` or BouncyCastle. `java.util.Random` is a linear congruential generator and its output is predictable from a handful of samples. The import check is what keeps this from firing on every retry jitter and test fixture in the tree.

Part of this code uses a predictable source of random numbers. If any key comes from it, that key can be guessed today, with no quantum computer needed.

What to do. `java.security.SecureRandom`. This is a classical defect, not a quantum one, and it is worth fixing first.

java.random.insecure · CWE-338
unknown Could not be determined 6 places See details

Cryptographic library in the dependency manifest

A dependency known to implement classical asymmetric cryptography. Its presence is inventory, not a finding about this codebase: the library may never be called with a quantum-vulnerable algorithm.

The project depends on a cryptography library. Listed so the inventory is complete; it is not by itself a problem.

What to do. Check the version. Several of these libraries have shipped ML-KEM and ML-DSA support since 2024, so the migration may need an upgrade rather than a replacement.

  1. adapters/saml/core/pom.xml:66 <artifactId>bcprov-jdk18on</artifactId>
  2. adapters/spi/adapter-spi/pom.xml:41 <artifactId>bcprov-jdk18on</artifactId>
  3. adapters/spi/jboss-adapter-core/pom.xml:58 <artifactId>bcprov-jdk18on</artifactId>
  4. crypto/default/pom.xml:59 <artifactId>bcprov-jdk18on</artifactId>
  5. dependencies/server-min/pom.xml:44 <artifactId>bcprov-jdk18on</artifactId>
  6. integration/client-cli/client-cli-dist/pom.xml:59 <artifactId>bcprov-jdk18on</artifactId>
dep.crypto-library
CSPRNG Quantum-safe 45 places See details

Random number generation

`SecureRandom`. A platform CSPRNG is not a quantum exposure; it is recorded because an inventory that omits the randomness source is incomplete. `SHA1PRNG` is named explicitly where it appears, since it is a legacy algorithm even though its output is adequate.

This is where the software gets its random numbers. Quantum computers do not weaken it.

What to do. No action. Prefer the platform default over naming an algorithm.

  1. adapters/saml/core/src/main/java/org/keycloak/adapters/cloned/HttpClientBuilder.java:265 new SecureRandom());
  2. common/src/main/java/org/keycloak/common/util/KeyUtils.java:89 SecureRandom randomGen = new SecureRandom();
  3. common/src/main/java/org/keycloak/common/util/SecretGenerator.java:34 private static final SecureRandom SECURE_RANDOM = new SecureRandom();
  4. common/src/main/java/org/keycloak/common/util/SecretGenerator.java:50 SECURE_RANDOM.nextBytes(data);
  5. common/src/main/java/org/keycloak/common/util/SecretGenerator.java:63 return SECURE_RANDOM.nextInt(bound);
  6. common/src/main/java/org/keycloak/common/util/SecretGenerator.java:85 buf[idx] = symbols[SECURE_RANDOM.nextInt(symbols.length)];
  7. common/src/main/java/org/keycloak/common/util/SecretGenerator.java:101 SECURE_RANDOM.nextBytes(buf);
  8. core/src/main/java/org/keycloak/jose/jwe/JWEUtils.java:32 new SecureRandom().nextBytes(buf);
  9. core/src/main/java/org/keycloak/mdoc/MdocCredential.java:47 private static final SecureRandom RANDOM = new SecureRandom();
  10. core/src/main/java/org/keycloak/mdoc/MdocCredential.java:238 RANDOM.nextBytes(output);
  11. core/src/main/java/org/keycloak/sdjwt/SdJwtUtils.java:43 private static final SecureRandom RANDOM = new SecureRandom();
  12. core/src/main/java/org/keycloak/sdjwt/SdJwtUtils.java:83 RANDOM.nextBytes(bytes);
  13. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:97 SecureRandom random = new SecureRandom();
  14. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:98 BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt()));
  15. crypto/default/src/main/java/org/keycloak/crypto/def/BCCertificateUtilsProvider.java:299 BigInteger serialNumber = new BigInteger(130, new SecureRandom());
  16. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:133 SecureRandom randomGen = new SecureRandom();
  17. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronCertificateUtilsProvider.java:99 SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
  18. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronCertificateUtilsProvider.java:100 BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt()));
  19. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:126 SecureRandom randomGen = SecureRandom.getInstance("SHA1PRNG");
  20. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:98 SecureRandom random = new SecureRandom();
  21. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:99 BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt()));
  22. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSCertificateUtilsProvider.java:300 BigInteger serialNumber = new BigInteger(130, new SecureRandom());
  23. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:143 SecureRandom randomGen = SecureRandom.getInstance("DEFAULT", "BCFIPS");
  24. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:341 SecureRandom sr = SecureRandom.getInstanceStrong();
  25. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:348 SecureRandom secRandom = new SecureRandom();
  26. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:358 SecureRandom.getInstance("DEFAULT", "BCFIPS");
  27. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPSRsaKeyEncryptionJWEAlgorithmProvider.java:41 .withSecureRandom(SecureRandom.getInstance("DEFAULT"));
  28. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPSRsaKeyEncryptionJWEAlgorithmProvider.java:55 wrapFact.createKeyWrapper(rsaPubKey, wrapParameters).withSecureRandom( SecureRandom.getInstance("DEFAULT"));
  29. federation/ldap/src/main/java/org/keycloak/storage/ldap/mappers/HardcodedLDAPAttributeMapper.java:94 SecureRandom r = new SecureRandom();
  30. federation/ldap/src/main/java/org/keycloak/storage/ldap/mappers/HardcodedLDAPAttributeMapper.java:97 char c = CHARS.charAt(r.nextInt(CHARS.length()));
  31. model/infinispan/src/main/java/org/keycloak/connections/infinispan/TopologyInfo.java:85 return InfinispanConnectionProvider.NODE_PREFIX + new SecureRandom().nextInt(1000000);
  32. model/jpa/src/main/java/org/keycloak/models/jpa/MigrationModelAdapter.java:90 sb.append(RESOURCE_TAG_CHARSET[new SecureRandom().nextInt(RESOURCE_TAG_CHARSET.length)]);
  33. saml-core/src/main/java/org/keycloak/saml/RandomSecret.java:37 SecureRandom random = new SecureRandom();
  34. saml-core/src/main/java/org/keycloak/saml/RandomSecret.java:39 random.nextBytes(secret);
  35. server-spi-private/src/main/java/org/keycloak/credential/hash/Pbkdf2PasswordHashProvider.java:128 SecureRandom secureRandom = new SecureRandom();
  36. server-spi-private/src/main/java/org/keycloak/credential/hash/Pbkdf2PasswordHashProvider.java:129 secureRandom.nextBytes(buffer);
  37. server-spi-private/src/main/java/org/keycloak/credential/hash/Salt.java:8 SecureRandom secureRandom = new SecureRandom();
  38. server-spi-private/src/main/java/org/keycloak/credential/hash/Salt.java:10 secureRandom.nextBytes(salt);
  39. server-spi/src/main/java/org/keycloak/models/utils/HmacOTP.java:51 SecureRandom r = new SecureRandom();
  40. server-spi/src/main/java/org/keycloak/models/utils/HmacOTP.java:54 char c = chars.charAt(r.nextInt(chars.length()));
  41. services/src/main/java/org/keycloak/connections/httpclient/HttpClientBuilder.java:273 new SecureRandom());
  42. services/src/main/java/org/keycloak/protocol/docker/installation/compose/DockerComposeCertsDirectory.java:30 keyGen.initialize(2048, new SecureRandom());
  43. services/src/main/java/org/keycloak/protocol/saml/DefaultSamlArtifactResolver.java:104 SecureRandom handleGenerator = new SecureRandom();
  44. services/src/main/java/org/keycloak/protocol/saml/DefaultSamlArtifactResolver.java:110 handleGenerator.nextBytes(assertionHandle);
  45. util/embedded-ldap/src/main/java/org/keycloak/util/ldap/TLS13StartTlsHandler.java:72 new SecureRandom());
java.rng
HMAC-SHA256 Quantum-safe 31 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

No known quantum attack changes how strong this is. A keyed MAC is not affected by Shor and only marginally by Grover.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:24 String HS256 = "HS256";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:55 case Algorithm.HS256:
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:97 case Algorithm.HS256:
  4. core/src/main/java/org/keycloak/jose/jwe/enc/AesCbcHmacShaJWEEncryptionProvider.java:31 if (JWEConstants.A128CBC_HS256.equals(jwaAlgorithmName)) {
  5. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:37 public static final String A128CBC_HS256 = "A128CBC-HS256";
  6. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:31 HS256(AlgorithmType.HMAC, null),
  7. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:223 encode(Algorithm.HS256, data, buffer);
  8. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:224 byte[] signature = HMACProvider.sign(buffer.toString().getBytes(StandardCharsets.UTF_8), Algorithm.HS256, sharedSecret);
  9. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:250 encode(Algorithm.HS256, data, buffer);
  10. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:251 byte[] signature = HMACProvider.sign(buffer.toString().getBytes(StandardCharsets.UTF_8), Algorithm.HS256, sharedSecret);
  11. core/src/main/java/org/keycloak/protocol/oidc/client/authentication/JWTClientSecretCredentialsProvider.java:48 private String clientSecretJwtAlg = Algorithm.HS256;
  12. core/src/main/java/org/keycloak/protocol/oidc/client/authentication/JWTClientSecretCredentialsProvider.java:81 if (Algorithm.HS256.equals(clientSecretJwtAlg) || Algorithm.HS384.equals(clientSecretJwtAlg) || Algorithm.HS512.equals(clientSecretJwtAlg))
  13. core/src/main/java/org/keycloak/protocol/oidc/client/authentication/JWTClientSecretCredentialsProvider.java:99 setClientSecret(clientSecretString, Algorithm.HS256);
  14. core/src/main/java/org/keycloak/util/TokenUtil.java:225 case 16: encAlgorithm = hmacKey != null ? JWEConstants.A128CBC_HS256 : JWEConstants.A128GCM;
  15. services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java:972 String alg = getConfig().getClientAssertionSigningAlg() != null ? getConfig().getClientAssertionSigningAlg() : Algorithm.HS256;
  16. services/src/main/java/org/keycloak/crypto/Aes128CbcHmacSha256ContentEncryptionProviderFactory.java:24 public static final String ID = JWEConstants.A128CBC_HS256;
  17. services/src/main/java/org/keycloak/crypto/ClientMacSignatureVerifierContext.java:34 if (algorithm == null) algorithm = Algorithm.HS256;
  18. services/src/main/java/org/keycloak/crypto/HS256ClientSignatureVerifierProviderFactory.java:23 public static final String ID = Algorithm.HS256;
  19. services/src/main/java/org/keycloak/crypto/HS256ClientSignatureVerifierProviderFactory.java:32 return new MacSecretClientSignatureVerifierProvider(session, Algorithm.HS256);
  20. services/src/main/java/org/keycloak/crypto/HS256SignatureProviderFactory.java:25 public static final String ID = Algorithm.HS256;
  21. services/src/main/java/org/keycloak/crypto/HS256SignatureProviderFactory.java:34 return new MacSecretSignatureProvider(session, Algorithm.HS256);
  22. services/src/main/java/org/keycloak/jose/jws/DefaultTokenManager.java:332 return getEncryptAlgorithm(OIDCConfigAttributes.ID_TOKEN_ENCRYPTED_RESPONSE_ENC, JWEConstants.A128CBC_HS256);
  23. services/src/main/java/org/keycloak/jose/jws/DefaultTokenManager.java:334 return JWEConstants.A128CBC_HS256;
  24. services/src/main/java/org/keycloak/jose/jws/DefaultTokenManager.java:340 return getEncryptAlgorithm(OIDCConfigAttributes.USER_INFO_ENCRYPTED_RESPONSE_ENC, JWEConstants.A128CBC_HS256);
  25. services/src/main/java/org/keycloak/keys/Attributes.java:89 Algorithm.HS256, Algorithm.HS384, Algorithm.HS512);
  26. services/src/main/java/org/keycloak/keys/DefaultKeyManager.java:162 KeyWrapper key = getActiveKey(realm, KeyUse.SIG, Algorithm.HS256);
  27. services/src/main/java/org/keycloak/keys/DefaultKeyManager.java:190 KeyWrapper key = getKey(realm, kid, KeyUse.SIG, Algorithm.HS256);
  28. services/src/main/java/org/keycloak/keys/DefaultKeyManager.java:220 return getKeysStream(realm, KeyUse.SIG, Algorithm.HS256)
  29. services/src/main/java/org/keycloak/keys/GeneratedHmacKeyProviderFactory.java:57 if (keyUse.equals(KeyUse.SIG) && (algorithm.equals(Algorithm.HS256) || algorithm.equals(Algorithm.HS384) || algorithm.equals(Algorithm.HS512))) {
  30. services/src/main/java/org/keycloak/keys/GeneratedHmacKeyProvider.java:32 super(model, KeyUse.SIG, KeyType.OCT, model.get(Attributes.ALGORITHM_KEY, Algorithm.HS256));
  31. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:119 case Algorithm.HS256, Algorithm.HS384, Algorithm.HS512 ->
jose.algorithm · CWE-327
HMAC-SHA512 Quantum-safe 25 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

No known quantum attack changes how strong this is. A keyed MAC is not affected by Shor and only marginally by Grover.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:26 String HS512 = "HS512";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:59 case Algorithm.HS512:
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:101 case Algorithm.HS512:
  4. core/src/main/java/org/keycloak/jose/jwe/enc/AesCbcHmacShaJWEEncryptionProvider.java:41 } else if (JWEConstants.A256CBC_HS512.equals(jwaAlgorithmName)) {
  5. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:39 public static final String A256CBC_HS512 = "A256CBC-HS512";
  6. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:33 HS512(AlgorithmType.HMAC, null),
  7. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:241 encode(Algorithm.HS512, data, buffer);
  8. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:242 byte[] signature = HMACProvider.sign(buffer.toString().getBytes(StandardCharsets.UTF_8), Algorithm.HS512, sharedSecret);
  9. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:268 encode(Algorithm.HS512, data, buffer);
  10. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:269 byte[] signature = HMACProvider.sign(buffer.toString().getBytes(StandardCharsets.UTF_8), Algorithm.HS512, sharedSecret);
  11. core/src/main/java/org/keycloak/protocol/oidc/client/authentication/JWTClientSecretCredentialsProvider.java:81 if (Algorithm.HS256.equals(clientSecretJwtAlg) || Algorithm.HS384.equals(clientSecretJwtAlg) || Algorithm.HS512.equals(clientSecretJwtAlg))
  12. core/src/main/java/org/keycloak/protocol/oidc/client/authentication/JWTClientSecretCredentialsProvider.java:114 if (Algorithm.HS512.equals(algorithm)) {
  13. core/src/main/java/org/keycloak/util/TokenUtil.java:229 case 32: encAlgorithm = hmacKey != null ? JWEConstants.A256CBC_HS512 : JWEConstants.A256GCM;
  14. server-spi-private/src/main/java/org/keycloak/models/Constants.java:69 public static final String INTERNAL_SIGNATURE_ALGORITHM = Algorithm.HS512;
  15. server-spi-private/src/main/java/org/keycloak/models/utils/DefaultKeyProviders.java:81 if (hasProvider(realm, "hmac-generated", Algorithm.HS512)) return;
  16. server-spi-private/src/main/java/org/keycloak/models/utils/DefaultKeyProviders.java:90 config.putSingle("algorithm", Algorithm.HS512);
  17. services/src/main/java/org/keycloak/crypto/Aes256CbcHmacSha512ContentEncryptionProviderFactory.java:24 public static final String ID = JWEConstants.A256CBC_HS512;
  18. services/src/main/java/org/keycloak/crypto/HS512ClientSignatureVerifierProviderFactory.java:23 public static final String ID = Algorithm.HS512;
  19. services/src/main/java/org/keycloak/crypto/HS512ClientSignatureVerifierProviderFactory.java:32 return new MacSecretClientSignatureVerifierProvider(session, Algorithm.HS512);
  20. services/src/main/java/org/keycloak/crypto/HS512SignatureProviderFactory.java:25 public static final String ID = Algorithm.HS512;
  21. services/src/main/java/org/keycloak/crypto/HS512SignatureProviderFactory.java:34 return new MacSecretSignatureProvider(session, Algorithm.HS512);
  22. services/src/main/java/org/keycloak/keys/Attributes.java:88 Algorithm.HS512,
  23. services/src/main/java/org/keycloak/keys/Attributes.java:89 Algorithm.HS256, Algorithm.HS384, Algorithm.HS512);
  24. services/src/main/java/org/keycloak/keys/GeneratedHmacKeyProviderFactory.java:57 if (keyUse.equals(KeyUse.SIG) && (algorithm.equals(Algorithm.HS256) || algorithm.equals(Algorithm.HS384) || algorithm.equals(Algorithm.HS512))) {
  25. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:119 case Algorithm.HS256, Algorithm.HS384, Algorithm.HS512 ->
jose.algorithm · CWE-327
SHA-512 Quantum-safe 22 places See details

Hash algorithm through the JCA

`MessageDigest.getInstance()`. MD5 and SHA-1 are reported as already broken; SHA-256 is reported as a reduced margin rather than a defect.

No known quantum attack changes how strong this is. No known quantum algorithm changes the security margin.

What to do. SHA-256 as the floor, SHA-384 where the digest protects something that must remain verifiable for decades.

  1. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:23 public static final String RS512 = "SHA512withRSA";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:29 public static final String ES512 = "SHA512withECDSA";
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:32 public static final String PS512 = "SHA512withRSAandMGF1";
  4. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:40 public static final String SHA512 = "SHA-512";
  5. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:54 return RS512;
  6. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:66 return ES512;
  7. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:72 return PS512;
  8. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:96 return SHA512;
  9. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:102 return SHA512;
  10. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:108 return SHA512;
  11. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:114 return SHA512;
  12. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:119 return SHA512;
  13. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:126 return SHA512;
  14. core/src/main/java/org/keycloak/jose/jws/crypto/ECDSAProvider.java:44 return "SHA512withECDSA";
  15. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:43 return "SHA512withRSA";
  16. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:49 return "SHA512withRSAandMGF1";
  17. core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java:57 return Signature.getInstance(getJavaAlgorithm(alg));
  18. model/jpa/src/main/java/org/keycloak/storage/jpa/JpaHashUtils.java:44 MessageDigest md = MessageDigest.getInstance(JavaAlgorithm.SHA512);
  19. model/jpa/src/main/java/org/keycloak/storage/jpa/JpaHashUtils.java:46 return md.digest();
  20. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:32 RSA_SHA512("http://www.w3.org/2001/04/xmldsig-more#rsa-sha512", "http://www.w3.org/2001/04/xmlenc#sha512", "SHA512withRSA"),
  21. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:33 RSA_SHA512_MGF1("http://www.w3.org/2007/05/xmldsig-more#sha512-rsa-MGF1", "http://www.w3.org/2001/04/xmlenc#sha512", "SHA512withRSAandMGF1"),
  22. server-spi/src/main/java/org/keycloak/models/utils/RecoveryAuthnCodesUtils.java:39 return HashUtils.hash(NOM_ALGORITHM_TO_HASH, rawGeneratedCode.getBytes(StandardCharsets.UTF_8));
java.messagedigest · CWE-328
HMAC-SHA384 Quantum-safe 21 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

No known quantum attack changes how strong this is. A keyed MAC is not affected by Shor and only marginally by Grover.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:25 String HS384 = "HS384";
  2. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:57 case Algorithm.HS384:
  3. core/src/main/java/org/keycloak/crypto/JavaAlgorithm.java:99 case Algorithm.HS384:
  4. core/src/main/java/org/keycloak/jose/jwe/enc/AesCbcHmacShaJWEEncryptionProvider.java:36 } else if (JWEConstants.A192CBC_HS384.equals(jwaAlgorithmName)) {
  5. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:38 public static final String A192CBC_HS384 = "A192CBC-HS384";
  6. core/src/main/java/org/keycloak/jose/jws/Algorithm.java:32 HS384(AlgorithmType.HMAC, null),
  7. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:232 encode(Algorithm.HS384, data, buffer);
  8. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:233 byte[] signature = HMACProvider.sign(buffer.toString().getBytes(StandardCharsets.UTF_8), Algorithm.HS384, sharedSecret);
  9. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:259 encode(Algorithm.HS384, data, buffer);
  10. core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java:260 byte[] signature = HMACProvider.sign(buffer.toString().getBytes(StandardCharsets.UTF_8), Algorithm.HS384, sharedSecret);
  11. core/src/main/java/org/keycloak/protocol/oidc/client/authentication/JWTClientSecretCredentialsProvider.java:81 if (Algorithm.HS256.equals(clientSecretJwtAlg) || Algorithm.HS384.equals(clientSecretJwtAlg) || Algorithm.HS512.equals(clientSecretJwtAlg))
  12. core/src/main/java/org/keycloak/protocol/oidc/client/authentication/JWTClientSecretCredentialsProvider.java:116 } else if (Algorithm.HS384.equals(algorithm)) {
  13. core/src/main/java/org/keycloak/util/TokenUtil.java:227 case 24: encAlgorithm = hmacKey != null ? JWEConstants.A192CBC_HS384 : JWEConstants.A192GCM;
  14. services/src/main/java/org/keycloak/crypto/Aes192CbcHmacSha384ContentEncryptionProviderFactory.java:24 public static final String ID = JWEConstants.A192CBC_HS384;
  15. services/src/main/java/org/keycloak/crypto/HS384ClientSignatureVerifierProviderFactory.java:23 public static final String ID = Algorithm.HS384;
  16. services/src/main/java/org/keycloak/crypto/HS384ClientSignatureVerifierProviderFactory.java:32 return new MacSecretClientSignatureVerifierProvider(session, Algorithm.HS384);
  17. services/src/main/java/org/keycloak/crypto/HS384SignatureProviderFactory.java:25 public static final String ID = Algorithm.HS384;
  18. services/src/main/java/org/keycloak/crypto/HS384SignatureProviderFactory.java:34 return new MacSecretSignatureProvider(session, Algorithm.HS384);
  19. services/src/main/java/org/keycloak/keys/Attributes.java:89 Algorithm.HS256, Algorithm.HS384, Algorithm.HS512);
  20. services/src/main/java/org/keycloak/keys/GeneratedHmacKeyProviderFactory.java:57 if (keyUse.equals(KeyUse.SIG) && (algorithm.equals(Algorithm.HS256) || algorithm.equals(Algorithm.HS384) || algorithm.equals(Algorithm.HS512))) {
  21. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:119 case Algorithm.HS256, Algorithm.HS384, Algorithm.HS512 ->
jose.algorithm · CWE-327
AES-256-KW Quantum-safe 20 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

No known quantum attack changes how strong this is. No known quantum algorithm changes the security margin.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. common/src/main/java/org/keycloak/common/crypto/CryptoConstants.java:16 public static final String ECDH_ES_A256KW = "ECDH-ES+A256KW";
  2. core/src/main/java/org/keycloak/crypto/Algorithm.java:56 String ECDH_ES_A256KW = CryptoConstants.ECDH_ES_A256KW;
  3. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:35 public static final String ECDH_ES_A256KW = CryptoConstants.ECDH_ES_A256KW;
  4. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:223 || Algorithm.ECDH_ES_A256KW.equals(alg)) {
  5. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:250 } else if (Algorithm.ECDH_ES_A256KW.equals(alg)) {
  6. crypto/default/src/main/java/org/keycloak/crypto/def/DefaultCryptoProvider.java:66 providers.put(CryptoConstants.ECDH_ES_A256KW, new BCEcdhEsAlgorithmProvider());
  7. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:191 || Algorithm.ECDH_ES_A256KW.equals(alg)) {
  8. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:205 } else if (Algorithm.ECDH_ES_A256KW.equals(alg)) {
  9. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:246 } else if (Algorithm.ECDH_ES_A256KW.equals(alg)) {
  10. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/WildFlyElytronProvider.java:67 providers.put(CryptoConstants.ECDH_ES_A256KW, new ElytronEcdhEsAlgorithmProvider());
  11. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:221 || Algorithm.ECDH_ES_A256KW.equals(alg)) {
  12. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/BCFIPSEcdhEsAlgorithmProvider.java:235 } else if (Algorithm.ECDH_ES_A256KW.equals(alg)) {
  13. crypto/fips1402/src/main/java/org/keycloak/crypto/fips/FIPS1402Provider.java:101 providers.put(CryptoConstants.ECDH_ES_A256KW, new BCFIPSEcdhEsAlgorithmProvider());
  14. services/src/main/java/org/keycloak/crypto/EcdhEsA256KwCekManagementProviderFactory.java:25 public static final String ID = JWEConstants.ECDH_ES_A256KW;
  15. services/src/main/java/org/keycloak/crypto/EcdhEsCekManagementProvider.java:39 || JWEConstants.ECDH_ES_A256KW.equals(jweAlgorithmName)) {
  16. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:49 Algorithm.ECDH_ES, Algorithm.ECDH_ES_A128KW, Algorithm.ECDH_ES_A192KW, Algorithm.ECDH_ES_A256KW);
  17. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:69 return Algorithm.ECDH_ES_A256KW;
  18. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:81 case Algorithm.ECDH_ES_A256KW :
  19. services/src/main/java/org/keycloak/keys/GeneratedEcdhKeyProviderFactory.java:149 || algorithm.equals(Algorithm.ECDH_ES_A192KW) || algorithm.equals(Algorithm.ECDH_ES_A256KW));
  20. services/src/main/java/org/keycloak/keys/JavaKeystoreKeyProvider.java:113 case Algorithm.ECDH_ES, Algorithm.ECDH_ES_A128KW, Algorithm.ECDH_ES_A192KW, Algorithm.ECDH_ES_A256KW ->
jose.algorithm · CWE-327
CSPRNG Quantum-safe 15 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. common/src/main/java/org/keycloak/common/util/SecretGenerator.java:107 for (byte b : randomBytes(length)) {
  2. common/src/main/java/org/keycloak/common/util/SecretGenerator.java:145 byte[] data = randomBytes(16);
  3. core/src/main/java/org/keycloak/sdjwt/SdJwtUtils.java:78 return encodeNoPad(randomBytes(16));
  4. model/infinispan/src/main/java/org/keycloak/models/sessions/infinispan/changes/remote/updater/authsession/RootAuthenticationSessionUpdater.java:169 String newTabId = Base64Url.encode(SecretGenerator.getInstance().randomBytes(8));
  5. model/infinispan/src/main/java/org/keycloak/models/sessions/infinispan/RootAuthenticationSessionAdapter.java:127 String tabId = Base64Url.encode(SecretGenerator.getInstance().randomBytes(8));
  6. model/jpa/src/main/java/org/keycloak/authentication/jpa/RootAuthenticationSessionAdapter.java:147 var tabId = Base64Url.encode(SecretGenerator.getInstance().randomBytes(8));
  7. services/src/main/java/org/keycloak/broker/oid4vp/OID4VPIdentityProvider.java:116 String nonce = Base64Url.encode(SecretGenerator.getInstance().randomBytes(32));
  8. services/src/main/java/org/keycloak/broker/oidc/OIDCIdentityProvider.java:971 String nonce = Base64Url.encode(SecretGenerator.getInstance().randomBytes(16));
  9. services/src/main/java/org/keycloak/keys/AbstractGeneratedSecretKeyProviderFactory.java:59 byte[] secret = SecretGenerator.getInstance().randomBytes(size);
  10. services/src/main/java/org/keycloak/protocol/oid4vc/issuance/credentialoffer/preauth/JwtPreAuthCodeHandler.java:38 String salt = Base64Url.encode(SecretGenerator.getInstance().randomBytes());
  11. services/src/main/java/org/keycloak/protocol/oidc/grants/device/endpoints/DeviceEndpoint.java:188 Base64Url.encode(SecretGenerator.getInstance().randomBytes()), request.getScope(), request.getNonce(), expiresIn, interval, null, null,
  12. services/src/main/java/org/keycloak/protocol/oidc/utils/PkceUtils.java:31 return Base64Url.encode(SecretGenerator.getInstance().randomBytes(64));
  13. services/src/main/java/org/keycloak/services/managers/AuthenticationManager.java:865 stateChecker = Base64Url.encode(SecretGenerator.getInstance().randomBytes());
  14. services/src/main/java/org/keycloak/services/managers/CodeGenerateUtil.java:107 String actionId = Base64Url.encode(SecretGenerator.getInstance().randomBytes());
  15. services/src/main/java/org/keycloak/services/resources/WelcomeResource.java:316 String stateChecker = Base64Url.encode(SecretGenerator.getInstance().randomBytes());
code.named-call
SHA-384 Quantum-safe 15 places See details

Hash algorithm through the JCA

`MessageDigest.getInstance()`. MD5 and SHA-1 are reported as already broken; SHA-256 is reported as a reduced margin rather than a defect.

No known quantum attack changes how strong this is. No known quantum algorithm changes the security margin.

What to do. SHA-256 as the floor, SHA-384 where the digest protects something that must remain verifiable for decades.

java.messagedigest · CWE-328
HMAC-SHA1 Quantum-safe 12 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. server-spi-private/src/main/java/org/keycloak/models/utils/CredentialValidation.java:33 return validator.validateTOTP(token, credentialModel.getDecodedSecret());
  2. server-spi-private/src/main/java/org/keycloak/models/utils/CredentialValidation.java:37 int c = validator.validateHOTP(token, credentialModel.getDecodedSecret(),
  3. server-spi/src/main/java/org/keycloak/models/UserCredentialModel.java:103 if (type.equals(HOTP)) return hotp(key);
  4. server-spi/src/main/java/org/keycloak/models/UserCredentialModel.java:104 if (type.equals(TOTP)) return totp(key);
  5. server-spi/src/main/java/org/keycloak/models/utils/HmacOTP.java:86 String candidate = generateHOTP(key, newCounter);
  6. server-spi/src/main/java/org/keycloak/models/utils/HmacOTP.java:126 hash = hmac_sha1(crypto, key, msg);
  7. services/src/main/java/org/keycloak/authentication/authenticators/browser/OTPFormAuthenticator.java:143 return form.createLoginTotp();
  8. services/src/main/java/org/keycloak/credential/OTPCredentialProvider.java:109 int counter = validator.validateHOTP(challengeResponse, otpCredentialModel.getDecodedSecret(), credentialData.getCounter());
  9. services/src/main/java/org/keycloak/credential/OTPCredentialProvider.java:118 final boolean isValid = validator.validateTOTP(challengeResponse, otpCredentialModel.getDecodedSecret());
  10. services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java:268 TotpBean totpBean = new TotpBean(session, realm, user, getTotpUriBuilder(), authenticationSession.getAuthNote(Constants.TOTP_SECRET_KEY));
  11. services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java:309 attributes.put("otpLogin", new TotpLoginBean(session, realm, user, (String) this.attributes.get(OTPFormAuthenticator.SELECTED_OTP_CREDENTIAL_ID)));
  12. services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java:312 attributes.put("configuredOtpCredentials", new TotpLoginBean(session, realm, user, (String) this.attributes.get(OTPFormAuthenticator.SELECTED_OTP_CREDENTIAL_ID)));
code.named-call
HMAC Quantum-safe 11 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. core/src/main/java/org/keycloak/protocol/oidc/client/authentication/JWTClientSecretCredentialsProvider.java:115 signedRequestToken = new JWSBuilder().jsonContent(jwt).hmac512(clientSecret);
  2. core/src/main/java/org/keycloak/protocol/oidc/client/authentication/JWTClientSecretCredentialsProvider.java:117 signedRequestToken = new JWSBuilder().jsonContent(jwt).hmac384(clientSecret);
  3. core/src/main/java/org/keycloak/protocol/oidc/client/authentication/JWTClientSecretCredentialsProvider.java:119 signedRequestToken = new JWSBuilder().jsonContent(jwt).hmac256(clientSecret);
  4. server-spi-private/src/main/java/org/keycloak/models/utils/CredentialValidation.java:35 HmacOTP validator = new HmacOTP(credentialModel.getOTPCredentialData().getDigits(),
  5. services/src/main/java/org/keycloak/credential/OTPCredentialProvider.java:108 HmacOTP validator = new HmacOTP(credentialData.getDigits(), credentialData.getAlgorithm(), policy.getLookAheadWindow());
  6. services/src/main/java/org/keycloak/crypto/Aes128CbcHmacSha256ContentEncryptionProviderFactory.java:33 return new AesCbcHmacShaContentEncryptionProvider(session, ID);
  7. services/src/main/java/org/keycloak/crypto/Aes192CbcHmacSha384ContentEncryptionProviderFactory.java:33 return new AesCbcHmacShaContentEncryptionProvider(session, ID);
  8. services/src/main/java/org/keycloak/crypto/Aes256CbcHmacSha512ContentEncryptionProviderFactory.java:33 return new AesCbcHmacShaContentEncryptionProvider(session, ID);
  9. services/src/main/java/org/keycloak/crypto/AesCbcHmacShaContentEncryptionProvider.java:36 return new AesCbcHmacShaJWEEncryptionProvider(jweAlgorithmName);
  10. services/src/main/java/org/keycloak/keys/DefaultKeyManager.java:163 return new ActiveHmacKey(key.getKid(), key.getSecretKey());
  11. services/src/main/java/org/keycloak/keys/GeneratedHmacKeyProviderFactory.java:52 return new GeneratedHmacKeyProvider(model);
code.named-call
HMAC-SHA256 Quantum-safe 10 places See details

Message authentication code through the JCA

`Mac.getInstance()`. HMAC is not broken by Shor and is only marginally affected by Grover; it is inventoried, not flagged, unless the underlying digest is broken.

This is a fingerprint used to prove a message was not altered. Quantum computers do not break it.

What to do. No action beyond avoiding HmacMD5 and HmacSHA1.

java.mac
HMAC-SHA512 Quantum-safe 9 places See details

Message authentication code through the JCA

`Mac.getInstance()`. HMAC is not broken by Shor and is only marginally affected by Grover; it is inventoried, not flagged, unless the underlying digest is broken.

This is a fingerprint used to prove a message was not altered. Quantum computers do not break it.

What to do. No action beyond avoiding HmacMD5 and HmacSHA1.

java.mac
HMAC-SHA384 Quantum-safe 8 places See details

Message authentication code through the JCA

`Mac.getInstance()`. HMAC is not broken by Shor and is only marginally affected by Grover; it is inventoried, not flagged, unless the underlying digest is broken.

This is a fingerprint used to prove a message was not altered. Quantum computers do not break it.

What to do. No action beyond avoiding HmacMD5 and HmacSHA1.

java.mac
AES-256-GCM Quantum-safe 7 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

No known quantum attack changes how strong this is. No known quantum algorithm changes the security margin.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/jose/jwe/enc/AesGcmJWEEncryptionProvider.java:35 } else if (JWEConstants.A256GCM.equals(jwaAlgorithmName)) {
  2. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:42 public static final String A256GCM = "A256GCM";
  3. core/src/main/java/org/keycloak/jose/jwe/JWERegistry.java:43 ENC_PROVIDERS.put(JWEConstants.A256GCM, new AesGcmJWEEncryptionProvider(JWEConstants.A256GCM));
  4. core/src/main/java/org/keycloak/util/TokenUtil.java:229 case 32: encAlgorithm = hmacKey != null ? JWEConstants.A256CBC_HS512 : JWEConstants.A256GCM;
  5. services/src/main/java/org/keycloak/broker/oid4vp/ResponseEncryption.java:41 List.of(JWEConstants.A128GCM, JWEConstants.A256GCM);
  6. services/src/main/java/org/keycloak/crypto/Aes256GcmContentEncryptionProviderFactory.java:24 public static final String ID = JWEConstants.A256GCM;
  7. services/src/main/java/org/keycloak/protocol/oid4vc/issuance/OID4VCIssuerWellKnownProvider.java:472 return List.of(JWEConstants.A256GCM);
jose.algorithm · CWE-327
AES-256-CBC Quantum-safe 5 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

No known quantum attack changes how strong this is. No known quantum algorithm changes the security margin.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/jose/jwe/enc/AesCbcHmacShaJWEEncryptionProvider.java:41 } else if (JWEConstants.A256CBC_HS512.equals(jwaAlgorithmName)) {
  2. core/src/main/java/org/keycloak/jose/jwe/JWEConstants.java:39 public static final String A256CBC_HS512 = "A256CBC-HS512";
  3. core/src/main/java/org/keycloak/jose/jwe/JWERegistry.java:46 ENC_PROVIDERS.put(JWEConstants.A256CBC_HS512, new AesCbcHmacShaEncryptionProvider.Aes256CbcHmacSha512Provider());
  4. core/src/main/java/org/keycloak/util/TokenUtil.java:229 case 32: encAlgorithm = hmacKey != null ? JWEConstants.A256CBC_HS512 : JWEConstants.A256GCM;
  5. services/src/main/java/org/keycloak/crypto/Aes256CbcHmacSha512ContentEncryptionProviderFactory.java:24 public static final String ID = JWEConstants.A256CBC_HS512;
jose.algorithm · CWE-327
HMAC Quantum-safe 5 places See details

Message authentication code through the JCA

`Mac.getInstance()`. HMAC is not broken by Shor and is only marginally affected by Grover; it is inventoried, not flagged, unless the underlying digest is broken.

This is a fingerprint used to prove a message was not altered. Quantum computers do not break it.

What to do. No action beyond avoiding HmacMD5 and HmacSHA1.

java.mac
AES-256-KW Quantum-safe 4 places See details

Classical public-key cipher through the JCA

`Cipher.getInstance()` with a transformation whose algorithm component is a public-key or legacy symmetric cipher. The transformation string is parsed into algorithm, mode and padding, so `RSA/ECB/PKCS1Padding` is separated from `RSA/ECB/OAEPWithSHA-256AndMGF1Padding`.

No known quantum attack changes how strong this is. No known quantum algorithm changes the security margin.

What to do. For RSA encryption, move to ML-KEM-768 and keep RSA-OAEP only as the classical half of a hybrid during transition.

  1. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:79 Cipher cipher = Cipher.getInstance(getAesWrapAlgorithm(header.getAlgorithm()));
  2. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:81 return cipher.unwrap(encodedCek, "AES", Cipher.SECRET_KEY).getEncoded();
  3. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:112 Cipher cipher = Cipher.getInstance(getAesWrapAlgorithm(header.getAlgorithm()));
  4. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:115 return cipher.wrap(new SecretKeySpec(cekBytes, "AES"));
java.cipher · CWE-327
SHA-384 Quantum-safe 4 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. core/src/main/java/org/keycloak/jose/jws/crypto/HashUtils.java:86 byte[] hashedOutput = hash(JavaAlgorithm.SHA384, inputBytes);
  2. services/src/main/java/org/keycloak/crypto/SHA384HashProviderFactory.java:27 public static final String ID = JavaAlgorithm.SHA384;
  3. services/src/main/java/org/keycloak/forms/login/freemarker/model/AuthenticationSessionBean.java:39 this.authSessionIdHash = Base64.getEncoder().withoutPadding().encodeToString(HashUtils.hash(JavaAlgorithm.SHA384, authSessionId.getBytes(StandardCharsets.UTF_8)));
  4. services/src/main/java/org/keycloak/services/managers/AuthenticationSessionManager.java:122 String authSessionIdHash = BASE_64_ENCODER_NO_PADDING.encodeToString(HashUtils.hash(JavaAlgorithm.SHA384, authSessionId.getBytes(StandardCharsets.UTF_8)));
code.algorithm-constant
AES-256256-bit Quantum-safe 3 places See details

Key type chosen by a setting

A named curve written as a string - `elliptic_curve="secp256r1"`, `"P-384"` in a list of accepted curves - or an RSA key size in a setting that names RSA (`rsa_key_size=2048`). The curve is reported as ECDSA where the file signs, ECDH where it agrees keys, and EC where it does both or neither.

This setting picks the kind of key the software makes.

What to do. The setting is where the key type changes; keep the list short so a post-quantum option can be added in one place.

code.curve
Argon2 Quantum-safe 3 places See details

Password hashing or key derivation

A `SecretKeyFactory` for PBKDF2, or a BouncyCastle password KDF. Not a quantum exposure, and part of a complete inventory.

This is how passwords are stored. Quantum computers do not meaningfully weaken it.

What to do. PBKDF2 needs a high iteration count. Argon2 through BouncyCastle is stronger.

  1. crypto/default/src/main/java/org/keycloak/crypto/hash/Argon2PasswordHashProvider.java:119 org.bouncycastle.crypto.params.Argon2Parameters.Builder builder = new org.bouncycastle.crypto.params.Argon2Parameters.Builder(Argon2Parameters.getTypeValue(type))
  2. crypto/default/src/main/java/org/keycloak/crypto/hash/Argon2PasswordHashProvider.java:130 Argon2BytesGenerator generator = new Argon2BytesGenerator();
  3. crypto/default/src/main/java/org/keycloak/crypto/hash/Argon2PasswordHashProvider.java:134 generator.generateBytes(rawPassword.toCharArray(), result);
java.kdf
HMAC-SHA1 Quantum-safe 3 places See details

Message authentication code through the JCA

`Mac.getInstance()`. HMAC is not broken by Shor and is only marginally affected by Grover; it is inventoried, not flagged, unless the underlying digest is broken.

This is a fingerprint used to prove a message was not altered. Quantum computers do not break it.

What to do. No action beyond avoiding HmacMD5 and HmacSHA1.

  1. server-spi/src/main/java/org/keycloak/models/utils/HmacOTP.java:32 public static final String HMAC_SHA1 = "HmacSHA1";
  2. server-spi/src/main/java/org/keycloak/models/utils/HmacOTP.java:35 public static final String DEFAULT_ALGORITHM = HMAC_SHA1;
  3. services/src/main/java/org/keycloak/authentication/otp/MicrosoftAuthenticatorOTPProvider.java:29 if (!policy.getAlgorithm().equals("HmacSHA1")) {
java.mac
SHA-384 Quantum-safe 3 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. services/src/main/java/org/keycloak/services/managers/AuthenticationManager.java:884 String sessionCookieValue = sha384UrlEncodedHash(session.getId());
  2. services/src/main/java/org/keycloak/services/managers/AuthenticationManager.java:1023 if (cookie.equals(sha384UrlEncodedHash(sessionId))) return true;
  3. services/src/main/java/org/keycloak/services/managers/AuthenticationManager.java:1805 return HashUtils.sha384UrlEncodedHash(input, StandardCharsets.ISO_8859_1);
code.named-call
SHA-512 Quantum-safe 3 places See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:118 key: "http://www.w3.org/2001/04/xmlenc#sha512",
  2. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:32 RSA_SHA512("http://www.w3.org/2001/04/xmldsig-more#rsa-sha512", "http://www.w3.org/2001/04/xmlenc#sha512", "SHA512withRSA"),
  3. saml-core/src/main/java/org/keycloak/saml/SignatureAlgorithm.java:33 RSA_SHA512_MGF1("http://www.w3.org/2007/05/xmldsig-more#sha512-rsa-MGF1", "http://www.w3.org/2001/04/xmlenc#sha512", "SHA512withRSAandMGF1"),
xmldsig.algorithm · CWE-327
SHA-512 Quantum-safe 3 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. model/jpa/src/main/java/org/keycloak/storage/jpa/JpaHashUtils.java:44 MessageDigest md = MessageDigest.getInstance(JavaAlgorithm.SHA512);
  2. server-spi/src/main/java/org/keycloak/models/utils/RecoveryAuthnCodesUtils.java:31 public static final String NOM_ALGORITHM_TO_HASH = JavaAlgorithm.SHA512;
  3. services/src/main/java/org/keycloak/crypto/SHA512HashProviderFactory.java:27 public static final String ID = JavaAlgorithm.SHA512;
code.algorithm-constant
AES-256-CBC Quantum-safe 2 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

code.algorithm-constant
CSPRNG Quantum-safe 2 places See details

Random number generation

`crypto.randomBytes()`, `randomUUID()` or `getRandomValues()`. A platform CSPRNG is not a quantum exposure; it is recorded because an inventory that omits the randomness source is incomplete. `Math.random()` is a separate, present-day defect.

This is where the software gets its random numbers. Quantum computers do not weaken it.

What to do. No action.

js.rng
ConcatKDF Quantum-safe 2 places See details

Password hashing or key derivation

A `SecretKeyFactory` for PBKDF2, or a BouncyCastle password KDF. Not a quantum exposure, and part of a complete inventory.

This is how passwords are stored. Quantum computers do not meaningfully weaken it.

What to do. PBKDF2 needs a high iteration count. Argon2 through BouncyCastle is stronger.

  1. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:157 ConcatenationKDFGenerator concatKdf = new ConcatenationKDFGenerator(DigestFactory.createSHA256());
  2. crypto/default/src/main/java/org/keycloak/crypto/def/BCEcdhEsAlgorithmProvider.java:161 concatKdf.generateBytes(derivedKeyBytes, 0, derivedKeyLength);
java.kdf
ConcatKDF Quantum-safe 2 places See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:139 ConcatKeyDerivationFunction concatKdf = new ConcatKeyDerivationFunction("SHA-256");
  2. crypto/elytron/src/main/java/org/keycloak/crypto/elytron/ElytronEcdhEsAlgorithmProvider.java:140 return concatKdf.kdf(z, keyDataLength, encodeDataLengthData(algorithmID.getBytes(Charset.forName("ASCII"))),
code.named-call
HMAC Quantum-safe 2 places See details

Algorithm named in a setting

A setting whose name says it holds an algorithm, given a literal that names one: `withOaepPaddingDigestAlgorithm("SHA-512")`, `signatureAlgorithm = "SHA256withRSA"`, `"digestAlgorithm": "SHA-256"`. The algorithm never reaches a `getInstance()` in this file - it is carried to one somewhere else, often through configuration - so a scan that only reads the factories cannot see it at all.

Something here is configured to use a named algorithm. The code that uses it may be somewhere else entirely, but this is the line that decides which algorithm it is.

What to do. Find what consumes the setting. The migration belongs to that operation; this line is where the choice is actually written down, and usually where it is easiest to change.

  1. model/jpa/src/main/resources/META-INF/jpa-changelog-1.8.0-db2.xml:150 <where>TYPE in ('password-history', 'password') AND ALGORITHM = 'HmacSHA1'</where>
  2. model/jpa/src/main/resources/META-INF/jpa-changelog-1.8.0.xml:150 <where>TYPE in ('password-history', 'password') AND ALGORITHM = 'HmacSHA1'</where>
config.algorithm-setting · CWE-327
HMAC-SHA1 Quantum-safe 2 places See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. server-spi/src/main/java/org/keycloak/models/OTPPolicy.java:53 algToKeyUriAlg.put(HmacOTP.HMAC_SHA1, "SHA1");
  2. server-spi/src/main/java/org/keycloak/models/OTPPolicy.java:75 public static OTPPolicy DEFAULT_POLICY = new OTPPolicy(OTPCredentialModel.TOTP, HmacOTP.HMAC_SHA1, 0, 6, 1, 30);
code.algorithm-constant
ML-DSA-44 Quantum-safe 2 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

No known quantum attack changes how strong this is. No known quantum algorithm changes the security margin.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:58 String ML_DSA_44 = "ML-DSA-44";
  2. core/src/main/java/org/keycloak/jose/jwk/AKPUtils.java:21 PREFIXES.put(Algorithm.ML_DSA_44, new byte[] { 48, -126, 5, 50, 48, 11, 6, 9, 96, -122, 72, 1, 101, 3, 4, 3, 17, 3, -126, 5, 33, 0, });
jose.algorithm · CWE-327
ML-DSA-65 Quantum-safe 2 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

No known quantum attack changes how strong this is. No known quantum algorithm changes the security margin.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:59 String ML_DSA_65 = "ML-DSA-65";
  2. core/src/main/java/org/keycloak/jose/jwk/AKPUtils.java:22 PREFIXES.put(Algorithm.ML_DSA_65, new byte[] { 48, -126, 7, -78, 48, 11, 6, 9, 96, -122, 72, 1, 101, 3, 4, 3, 18, 3, -126, 7, -95, 0, });
jose.algorithm · CWE-327
ML-DSA-87 Quantum-safe 2 places See details

JOSE algorithm declared in configuration

An `alg` value in JSON or YAML. `none` is reported as a critical defect; HS* is an HMAC and is not quantum-vulnerable; RS*, PS*, ES* and EdDSA are.

No known quantum attack changes how strong this is. No known quantum algorithm changes the security margin.

What to do. No standardised post-quantum JOSE algorithm exists yet. Keep token lifetimes short.

  1. core/src/main/java/org/keycloak/crypto/Algorithm.java:60 String ML_DSA_87 = "ML-DSA-87";
  2. core/src/main/java/org/keycloak/jose/jwk/AKPUtils.java:23 PREFIXES.put(Algorithm.ML_DSA_87, new byte[] { 48, -126, 10, 50, 48, 11, 6, 9, 96, -122, 72, 1, 101, 3, 4, 3, 19, 3, -126, 10, 33, 0, });
jose.algorithm · CWE-327
AES-256-CBC Quantum-safe 1 place See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:67 key: "http://www.w3.org/2001/04/xmlenc#aes256-cbc",
xmldsig.algorithm · CWE-327
AES-256-GCM Quantum-safe 1 place See details

XML signature or encryption algorithm

An XML Signature or XML Encryption algorithm URI - SAML, XAdES or WS-Security. The URI names the algorithm exactly, and a signature URI names its digest as well, so `#rsa-sha1` reports both the key and the broken digest.

Federated login and signed XML documents name their cryptography in a web address. Some of those addresses name algorithms that are already broken.

What to do. Move off `#rsa-sha1` first: that signature is forgeable today, with no quantum computer involved. The key algorithm changes with the wider migration.

  1. js/apps/admin-ui/src/clients/add/SamlEncryption.tsx:55 key: "http://www.w3.org/2009/xmlenc11#aes256-gcm",
xmldsig.algorithm · CWE-327
AES-256-GCM Quantum-safe 1 place See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. saml-core/src/main/java/org/keycloak/saml/BaseSAML2BindingBuilder.java:73 protected String encryptionAlgorithm = XMLCipher.AES_256_GCM;
code.algorithm-constant
AES-256-KW Quantum-safe 1 place See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

code.algorithm-constant
Argon2 Quantum-safe 1 place See details

Call to code named for an algorithm

A call, construction or operation whose own name states the algorithm: a project's wrapper such as `Hash.sha256(data)`, `hmacSha256(key, msg)`, `getMD5()` or `new ScryptGenerator(..)`, a key type such as `new Ed25519PublicKey(bytes)`, or an operation on an object named for its algorithm, `sha256.digest()`. The library call inside the wrapper is reported where it is written; these are the places it is used.

This line calls code named after an encryption or hashing method.

What to do. Migrate the wrapper once, and these call sites follow it.

  1. crypto/default/src/main/java/org/keycloak/crypto/hash/Argon2PasswordHashProviderFactory.java:52 return new Argon2PasswordHashProvider(version, type, hashLength, memory, iterations, parallelism, cpuCoreSemaphore, blockChunkManager);
code.named-call
Argon2d Quantum-safe 1 place See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. crypto/default/src/main/java/org/keycloak/crypto/hash/Argon2Parameters.java:20 types.put("d", org.bouncycastle.crypto.params.Argon2Parameters.ARGON2_d);
code.algorithm-constant
Argon2i Quantum-safe 1 place See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. crypto/default/src/main/java/org/keycloak/crypto/hash/Argon2Parameters.java:21 types.put("i", org.bouncycastle.crypto.params.Argon2Parameters.ARGON2_i);
code.algorithm-constant
Argon2id Quantum-safe 1 place See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. crypto/default/src/main/java/org/keycloak/crypto/hash/Argon2Parameters.java:19 types.put("id", org.bouncycastle.crypto.params.Argon2Parameters.ARGON2_id);
code.algorithm-constant
HMAC Quantum-safe 1 place See details

Key material constructed for a named algorithm

`new SecretKeySpec(bytes, "AES")` and the other key-spec constructors name the algorithm as an argument rather than through `getInstance()`. Code that wraps raw bytes into a key this way often never calls `getInstance()` at all, so the algorithm is invisible to a scan that only looks at the factories.

This wraps raw bytes into a key for a named algorithm. It is part of the same migration as whatever uses that key.

What to do. Wherever this key is used, the same migration applies as to the call that consumes it. Trace it to the operation and treat the two together.

  1. core/src/main/java/org/keycloak/jose/jwe/enc/AesCbcHmacShaEncryptionProvider.java:169 SecretKeySpec hmacKey = new SecretKeySpec(cekMacKey, "HMACSHA2");
java.keyspec · CWE-327
HMAC-SHA256 Quantum-safe 1 place See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. server-spi/src/main/java/org/keycloak/models/OTPPolicy.java:54 algToKeyUriAlg.put(HmacOTP.HMAC_SHA256, "SHA256");
code.algorithm-constant
HMAC-SHA512 Quantum-safe 1 place See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. server-spi/src/main/java/org/keycloak/models/OTPPolicy.java:55 algToKeyUriAlg.put(HmacOTP.HMAC_SHA512, "SHA512");
code.algorithm-constant
SHA-384 Quantum-safe 1 place See details

Algorithm named in a setting

A setting whose name says it holds an algorithm, given a literal that names one: `withOaepPaddingDigestAlgorithm("SHA-512")`, `signatureAlgorithm = "SHA256withRSA"`, `"digestAlgorithm": "SHA-256"`. The algorithm never reaches a `getInstance()` in this file - it is carried to one somewhere else, often through configuration - so a scan that only reads the factories cannot see it at all.

Something here is configured to use a named algorithm. The code that uses it may be somewhere else entirely, but this is the line that decides which algorithm it is.

What to do. Find what consumes the setting. The migration belongs to that operation; this line is where the choice is actually written down, and usually where it is easiest to change.

  1. core/src/main/java/org/keycloak/sdjwt/IssuerSignedJWT.java:218 OID4VCConstants.SD_HASH_DEFAULT_ALGORITHM, "sha-384", "sha-512",
config.algorithm-setting · CWE-327
SHA-384 Quantum-safe 1 place See details

Hash function in use

`createHash()` or `subtle.digest()`. The digest is read from the argument, so one rule covers the family: MD5 and SHA-1 are reported as broken, SHA-256 as a reduced margin, SHA-384 and above as inventory.

No known quantum attack changes how strong this is. No known quantum algorithm changes the security margin.

What to do. SHA-256 as the floor, SHA-384 where the digest protects something long-lived.

js.hash · CWE-328
SHAKE256 Quantum-safe 1 place See details

Algorithm named by a constant

A library or project constant whose name is an algorithm, used in code: `JavaAlgorithm.SHA256`, `XMLCipher.AES_128`, Go `crypto.SHA256` and `x509.SHA256WithRSA`, `SignatureMethod.RSA_SHA256`. The holder's name has to say it holds algorithms, so an unrelated `Foo.AES` is left alone.

This line picks an algorithm by name.

What to do. The migration belongs to the operation that consumes the constant; this line is where the choice is written down.

  1. services/src/main/java/org/keycloak/crypto/SHAKE256HashProviderFactory.java:28 public static final String ID = JavaAlgorithm.SHAKE256;
code.algorithm-constant

Cryptographic assets

Algorithm Assessment What it means Occurrences
unknown Could not be determined The algorithm could not be established from the source - chosen at runtime, or decided somewhere this scan does not reach. 353
HMAC Quantum-safe A keyed MAC is not affected by Shor and only marginally by Grover. 142
RSASSA-PKCS1v15 Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. The v1.5 signature scheme of RFC 8017 section 8.2 has no classical break of its own; RSA-PSS is preferred for new work, but the quantum exposure is the same for both. 130
ECDSA Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 122
ECDH Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 112
SHA-256 Reduced margin Pre-image resistance falls to about 128 bits of quantum work. Adequate for most uses; SHA-384 restores the full margin where a signature must last decades. 99
RSA-PSS Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 86
RSA Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 72
CSPRNG Quantum-safe A cryptographically secure random number generator provided by the platform. Not weakened by a quantum computer. 62
TLS Quantum-vulnerable Every TLS cipher suite in general use negotiates a classical key exchange, so a recorded session is decryptable once that exchange falls. 60
X.509 Could not be determined An X.509 certificate, signing request or revocation list, or a signature over one. The algorithm is the key's, which this code does not name. 60
RSA-OAEP Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 53
AES Reduced margin Grover's algorithm halves the effective strength; the parameter, not the design, is the problem. The key size was not visible at this call site, so the weaker case is assumed. 48
Ed25519 Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 41
AES-128-KW Reduced margin Grover's algorithm halves the effective strength; the parameter, not the design, is the problem. 34
SHA-1 Already broken SHAttered and subsequent work produced practical collisions; NIST withdrew SHA-1 in 2030 guidance and it is already unacceptable for signatures. 29
SHA-512 Quantum-safe No known quantum algorithm changes the security margin. 28
AES-192-KW Reduced margin Grover's algorithm halves the effective strength; the parameter, not the design, is the problem. 25
AES-256-KW Quantum-safe No known quantum algorithm changes the security margin. 25
SHA-384 Quantum-safe No known quantum algorithm changes the security margin. 24
AES-128 Reduced margin Grover's algorithm halves the effective strength; the parameter, not the design, is the problem. 22
RSAES-PKCS1v15 Already broken PKCS#1 v1.5 encryption padding is vulnerable to Bleichenbacher oracles today, and the underlying RSA is broken by Shor. 22
Kerberos Reduced margin Kerberos is symmetric at its core, so Shor does not break it. The surrounding PKINIT certificate flow is public-key and does fall. 21
AES-256 Quantum-safe No known quantum algorithm changes the security margin. 20
AES-192 Reduced margin Grover's algorithm halves the effective strength; the parameter, not the design, is the problem. 16
EC Quantum-vulnerable An elliptic-curve key pair. The source does not say whether it signs or agrees a shared secret, and the curve alone cannot: the same curve serves both. 15
DSA Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 13
Ed448 Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 11
EdDSA Quantum-vulnerable Broken by Shor's algorithm on a cryptographically relevant quantum computer. 9
AES-KW Reduced margin Grover's algorithm halves the effective strength; the parameter, not the design, is the problem. 8
Argon2 Quantum-safe The current recommended password hashing function. Not affected by Shor, and memory-hard against Grover. 7
PBKDF2 Reduced margin Not broken by a quantum computer, but weak against modern GPU cracking at low iteration counts, which is a present-day concern. 7
MD5 Already broken Practical chosen-prefix collisions exist; MD5 has no remaining security as a digest. 5
ConcatKDF Quantum-safe No known quantum algorithm changes the security margin. 4
ML-DSA-44 Quantum-safe No known quantum algorithm changes the security margin. 2
ML-DSA-65 Quantum-safe No known quantum algorithm changes the security margin. 2
ML-DSA-87 Quantum-safe No known quantum algorithm changes the security margin. 2
SHAKE256 Quantum-safe No known quantum algorithm changes the security margin. 1

Imported cryptographic libraries

Library Files
javax.net.ssl the TLS client and server 34
org.bouncycastle BouncyCastle, whose low-level API bypasses the JCA algorithm strings. It has shipped ML-KEM and ML-DSA since 1.79 22
org.ietf.jgss GSS-API, usually Kerberos or SPNEGO 5
@noble/hashes hash functions 1
java.security the JCA 279