Skip to content

feat(crypto): recognize ML-KEM and SLH-DSA algorithms #11639

Description

@nikpivkin

ML-KEM and SLH-DSA appear in X.509 certificates and PKIX public keys. ML-KEM is only a key algorithm, because a KEM cannot sign, so a certificate with an ML-KEM key is signed with another algorithm (RFC 9935). SLH-DSA is a signature algorithm, and its OID names both the key and the certificate signature (RFC 9909). OpenSSL 3.5 and later can generate keys and certificates with these algorithms.

Such certificates and keys already reach the crypto inventory, but only by their OID. They get no name, family, primitive, key size or NIST category. Trivy should describe them the same way it describes ML-DSA.

ML-KEM has three parameter sets, ML-KEM-512, ML-KEM-768 and ML-KEM-1024, with the OIDs 2.16.840.1.101.3.4.4.1 to 2.16.840.1.101.3.4.4.3. CycloneDX gives ML-KEM the kem primitive, which Trivy does not have yet.

SLH-DSA has 12 parameter sets with SHA2 and SHAKE, with the OIDs 2.16.840.1.101.3.4.3.20 to 2.16.840.1.101.3.4.3.31. HashSLH-DSA uses the same parameter sets with a pre-hash, with the OIDs 2.16.840.1.101.3.4.3.35 to 2.16.840.1.101.3.4.3.46. RFC 9909 allows both in X.509, so both are in scope. HashML-DSA stays out because RFC 9881 forbids it in X.509.

The key size is the length of the encoded public key, as for ML-DSA. The NIST categories come from FIPS 203 and FIPS 205. As with ML-DSA, there is no classical security level.

Private keys of these algorithms are still skipped because Go cannot parse them. They need a PKCS#8 fallback, which is a separate change tracked in #10962.

References

Activity

  1. added
    kind/feature
    scan/crypto
    on Nov 13, 2026
  2. diamond-nicholas commented on Nov 18, 2026

    @diamond-nicholas

    Hi @nikpivkin! I'd like to work on this one. I'm a DevSecOps engineer working mostly on AWS security, and post-quantum readiness is starting to come up in our crypto inventories. I looked at how ML-DSA is done: pkg/crypto/catalog.go has an entry per parameter-set OID with mldsaStrengthBasis(), while ftypes.CryptoPrimitive only has unknown, signature and pke, so ML-KEM certificates and keys currently show up by OID only.

    My plan:

    1. Add a CryptoPrimitiveKEM ("kem") to pkg/fanal/types/crypto_algorithm.go, accept it in the validation in crypto.go, and map it to the CycloneDX kem primitive in pkg/sbom/cyclonedx/crypto.go.
    2. Add catalog entries for ML-KEM-512/768/1024 (2.16.840.1.101.3.4.4.1-3, kem, NIST categories 1/3/5), the 12 SLH-DSA sets (.4.3.20-31) and the 12 HashSLH-DSA sets (.4.3.35-46) as signature with their FIPS 205 categories, with key size taken from the encoded public key length as for ML-DSA.
    3. Add tests with certificates and PKIX public keys generated by OpenSSL 3.5 (an ML-KEM certificate signed by ML-DSA or ECDSA, and SLH-DSA SHA2 and SHAKE ones), checking name, family, primitive, key size and NIST category, plus the CycloneDX output.

    Questions: should HashSLH-DSA share the SLH-DSA family with a different name (e.g. HashSLH-DSA-SHA2-128s), or be its own family? And for an ML-KEM certificate, should the signature algorithm asset stay separate from the key asset, as it is for other certificates?

    Could you assign it to me?

  3. nikpivkin commented on Nov 18, 2026

    @nikpivkin
    ContributorAuthor

    @diamond-nicholas Thank you for your interest, but we're already working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featurescan/crypto

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions