Skip to content

tls 1.4.4: truncation protection and protocol hardening

Choose a tag to compare

@Mosaad-M Mosaad-M released this 05 Oct 09:51
· 39 commits to master since this release
d185e08

Security hardening release. Upgrade from 1.4.3 or earlier.

Security

  • Truncation:
    • recv_all() returns only after an authenticated close_notify. A bare TCP close raises tls: truncated: connection closed without close_notify; pass allow_truncation=True to accept it.
    • Plaintext or undecryptable alerts after the handshake are rejected (forged close_notify).
    • A record cut off part-way raises tls: truncated record.
  • RSA: fixed out-of-bounds reads in PKCS#1 v1.5 verification on malformed signatures, which crashed the process.
  • X25519: an all-zero shared secret (low-order point) and keys that aren't 32 bytes are rejected.
  • Downgrade: the TLS 1.3 downgrade sentinel is detected in TLS 1.2 ServerHellos.
  • CertificateVerify: TLS 1.3 no longer accepts PKCS#1 v1.5 (rsa_pkcs1_sha256).
  • Hostnames: *.com-style wildcards and wildcards matching IP addresses are rejected.
  • Record padding: TLS 1.3 record padding is removed correctly.

API

  • recv_all(max_size, allow_truncation=False)
  • close_notify_received() -> Bool
  • Unchanged for recv(): at a bare TCP close it still raises an error containing "connection closed", so existing read-to-close callers behave as before.

Interoperability

  • TLS 1.2 ServerKeyExchange accepts RSA-PSS, which the ClientHello already offered.
  • rsa_pkcs1_sha512, which could not be verified, is no longer offered. TLS 1.2 RSA servers such as badssl.com previously failed the handshake.

See the README's "End of stream" and "Security status" sections.