Core: `SecurityUtils.createMtlsKeyStore` should use a fixed algorithm for creating the `PrivateKey`
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
Piste de recherche
Commencez par SecurityUtils.createMtlsKeyStore et examinez la gestion actuelle de IllegalArgumentException autour de l'appel à KeyFactory montré dans l'issue. Consultez les recommandations d'Error Prone concernant InsecureCipherMode ainsi que l'API de InvalidAlgorithmParameterException, puis exécutez le build avec Error Prone activé. Le travail est terminé lorsque les algorithmes de clé non sûrs ou non pris en charge sont gérés comme indiqué et que l'avertissement est résolu.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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() was DH or DSA, 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 an InvalidAlgorithmParameterException if it is not one of those. In addition, special case DH and DSA to give references to their vulnerabilities as described in InsecureCypherMode.identifyDiffieHellmanAndDsaVulnerabilities.
/cc @sophieschmieg, as her guidance/requirements will be canonical for importing whatever changes are made here into the monorepo.
Environment details
- API: Core
- OS type and version: 5.17.6-1rodete1-amd64
- Java version: OpenJDK Runtime Environment (build 11.0.13+8-google-release-451398016) OpenJDK 64-Bit Server VM (build 11.0.13+8-google-release-451398016, mixed mode, sharing)
- version(s): ~head (with local patches)
Steps to reproduce
- Add errorprone warnings to the build
- Build.
SecurityUtils.createMtlsKeyStore will generate an InsecureCipherMode warning.
Code example
PrivateKey key =
KeyFactory.getInstance(cert.getPublicKey().getAlgorithm()).generatePrivate(keySpecPKCS8);
- Langage dominant
- Java
- Étoiles
- 1.4k
- Forks
- 476
- Merge moyen
- 10 h 47 min
- PR mergées (30 j)
- 3
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de googleapis/google-http-java-client
-
Core: Validate header names and values to prevent CRLF injectionPeut-être pris @insaf021 l’a pris il y a 106 jours. Ouvertepriority: p3
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Core: XmlPullParser processes external DTD entities (XXE) — disable FEATURE_PROCESS_DOCDECL in Xml#createParser()Peut-être pris @insaf021 l’a pris il y a 106 jours. Ouvertepriority: p3
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
-
Core: LowLevelHttpResponse not disconnected when HttpResponse construction throws RuntimeExceptionPeut-être pris @insaf021 l’a pris il y a 106 jours. Ouvertepriority: p3
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
-
type: cleanup
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
org.apache.http.conn.ssl.SSLSocketFactory is deprecatedPeut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. Ouvertepriority: p2 type: cleanup
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
Toutes les issues de googleapis/google-http-java-client
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 80/100
finos/fluxnova-bpm-platform#387 ·
Les mainteneurs répondent en général sous 4 jours
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
-
Difficulté 2/5 Moins d'une heure Accessibilité débutants 84/100
cpp-best-practices/project_validator#251 ·
Les mainteneurs répondent en général sous 1 jour
-
backend enhancement
Difficulté 2/5 Une demi-journée Accessibilité débutants 70/100
damodharg6/payledger#16 ·
-
[Bug]: An initiative list with no current entry logs an error on every changePeut-être pris @dwizard0 l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour