Skip to content

cargo should force strong TLS 1.2 cipher suites to reduce downgrade attacks because crates.io offers many "weak" TLS 1.0-1.2 cipher suites #8113

Open
@x448

Description

@x448

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
(click to expand) 📷 SSL Report (Qualys) for crates.io

image

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.

(click to expand) 📷 SSL Client Test of Firefox 68 ESR (hardened)

image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-configurationArea: cargo config files and env varsA-networkingArea: networking issues, curl, etc.A-securityArea: securityC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions