Core: SecurityUtils.createMtlsKeyStore
should use a fixed algorithm for creating the PrivateKey
#1675
Labels
priority: p3
Desirable enhancement or fix. May not be included in next release.
Callers of
SecurityUtils.createMtlsKeyStore
can direct the use of insecure algorithms in the construction of the mTLS connection. In general, we attempt to affix the algorithm used to inhibit use of algorithms with known vulnerabilities.Personally, I would be fine with denying provided certs whose
cert.getPublicKey().getAlgorithm()
wasDH
orDSA
, but in lieu of blocklisting known bad algorithms, perhaps it'd be more security affirmative to allowlist currently-OK algorithms, so we only ever use good versions, and suffer toil later if we have to retrofit additional entries.My suggestion is to create a case statement just below where the method currently throws
IllegalArgumentException
for various cases, and add the set of known good algorithms, and throw anInvalidAlgorithmParameterException
if it is not one of those. In addition, special caseDH
andDSA
to give references to their vulnerabilities as described inInsecureCypherMode.identifyDiffieHellmanAndDsaVulnerabilities
./cc @sophieschmieg, as her guidance/requirements will be canonical for importing whatever changes are made here into the monorepo.
Environment details
Steps to reproduce
SecurityUtils.createMtlsKeyStore
will generate anInsecureCipherMode
warning.Code example
The text was updated successfully, but these errors were encountered: