Description
Describe the problem you are trying to solve
crates.io is using servers that offer TLS 1.0, TLS 1.1, and TLS 1.2 with a numerous "weak" cipher suites enabled according to SSL Report.
The downgrade protection mechanism in TLS 1.2 relies on downgradeable parameters. So we should force TLS 1.2 to only allow strong cipher suites (reduce possible downgrade attacks).
cargo should add protection against TLS 1.2 downgrade attacks instead of relying solely on crates.io (vendors can change or make mistakes, etc. so a server-only fix isn't enough).
A similar issue was resolved in rustup-init.sh in rust-lang/rustup#2287 on April 22, 2020.
From EUROCRYPT 2016, Protecting TLS from Legacy Crypto (pdf, iacr.org):
What can go wrong?
- We get lazy and forget to remove weak algorithms
- Downgrade attacks that exploit obsolete legacy crypto
Describe the solution you'd like
cargo should force use of strong TLS 1.2 cipher suites (if supported by required libraries).
cargo can provide an [http] option to enable this (as opt-in, until there's enough confidence to make it the default behavior).
[http]
require-ecdhe-aead = true # Force ECDHE+AEAD in TLS 1.2 (already true for TLS 1.3).
Ideally, I'd like to see the same 9 cipher suites as Firefox 68 ESR with all weak cipher suites disabled via about:config
.
Example of client-side OpenSSL cipher suites list tested with curl and wget --ciphers
option:
TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384
DHE is excluded from cipher suites because servers often use bad DH params (see RFC 7919).
Notes
(click to expand) Links to RFC and etc. about TLS
-
2008. TLS 1.2 was defined in RFC 5246 in August 2008.
-
2015. Imperfect Forward Secrecy: How Diffie-Hellman Fails in Practice (pdf, weakdh.org)
22nd ACM Conference on Computer and Communications Security (CCS ’15), Denver, CO, October 2015. Best Paper Award Winner. -
2016. RFC 7919 Negotiated Finite Field Diffie-Hellman Ephemeral Parameters for Transport Layer Security (TLS).
-
2016. Protecting TLS from Legacy Crypto (pdf, iacr.org) KarthikeyanBhargavan+ many, many others.(INRIA, Microsoft Research, LORIA, IMDEA,Univof Pennsylvania, Univof Michigan, JHU)
-
2018. TLS 1.3 was defined in RFC 8446