
TLS / SSL information leakage
What weak TLS configurations and TLS library bugs leak, how they enable interception and session theft, and how to test and fix them.
TLS (and SSL before it) encrypts web and service traffic. The handshake agrees on a protocol version, a cipher suite and keys. A server that still accepts old protocols, offers weak ciphers or runs a buggy TLS library can leak metadata (certificate chains, supported ciphers, error details) and sometimes secrets such as private keys and session cookies.
Why it matters
Heartbleed (CVE-2014-0160) was a bug in OpenSSL, not a configuration mistake, and it let anyone read chunks of server memory: private keys, credentials, session data. Configuration problems are more common. SSLv3, TLS 1.0 and weak ciphers are still enabled on plenty of hosts.
Impact
- TLS is what keeps traffic confidential and unmodified. If it is broken, passwords, tokens and cookies in transit can be read or changed.
- Servers that accept legacy protocols or weak ciphers are open to downgrade and plaintext-recovery attacks such as POODLE and BEAST.
- Certificate details, cipher lists, server names and handshake errors help with fingerprinting. Certificate Transparency (CT) logs make every issued certificate, and so every hostname on it, public.
- Outdated protocols and mixed content can fail compliance requirements (PCI DSS, HIPAA), and browsers warn users about them.
Common misconfiguration classes
| Problem | Fix |
|---|---|
| Old protocols (SSLv2/3, TLS 1.0/1.1) enabled | Offer only TLS 1.2 and 1.3. TLS_FALLBACK_SCSV stops forced fallback on servers that must keep older versions. |
| Weak cipher suites (RC4, 3DES, export suites) or no forward secrecy | Use ECDHE or DHE key exchange with AES-GCM or ChaCha20-Poly1305. |
| No HSTS, mixed content | Send Strict-Transport-Security with includeSubDomains, and preload once every subdomain supports HTTPS. Serve nothing sensitive over HTTP. |
| Broken certificate validation in clients or mTLS | Check the full chain and the hostname. If you pin, plan the key rollover before you ship. |
| Exposed private keys | Keep keys in an HSM or cloud KMS, restrict file access, and check backups and repositories for stray keys. |
| Library bugs such as Heartbleed | Patch OpenSSL, BoringSSL, NSS and the like, and track their CVEs. |
| Verbose TLS errors returned to clients | Log handshake detail on the server only. |
| No OCSP stapling | Turn on stapling and alert when it fails. |
Tokens in URLs leaking through Referer after redirects | Keep tokens out of URLs and keep redirects on HTTPS. |
Attack scenarios
- Weak or broken TLS lets an attacker in the path read and modify traffic (man-in-the-middle).
- Cookies, API tokens or credentials read off the wire lead to account takeover.
- Without forward secrecy, anyone who later gets the server's private key can decrypt traffic they recorded earlier.
- TLS metadata helps fingerprint the infrastructure and pick out components with known bugs.
- Forcing an older protocol or cipher drops the connection to the weakest option both sides support.
Detection and testing
- Qualys SSL Labs grades public HTTPS endpoints.
- From the command line:
openssl s_client -connect host:443 -servername host,nmap --script ssl-enum-ciphers -p 443 host,sslyze,testssl.sh. - Run
sslyzeortestssl.shagainst staging in CI to catch regressions. - Capture handshakes with
tcpdumpor Wireshark to see the version and cipher actually negotiated. - Watch CT logs for certificates you did not request.
Quick checks:
# show server certificate chain and negotiated cipher
openssl s_client -connect example.com:443 -servername example.com
# enumerate supported ciphers with nmap
nmap --script ssl-enum-ciphers -p 443 example.comRemediation and hardening
- Turn off SSLv2/3 and TLS 1.0/1.1. Prefer TLS 1.3 and keep TLS 1.2 where clients need it. Enable
TLS_FALLBACK_SCSV. - Remove RC4, DES/3DES, export and anonymous suites. Use AES-GCM or ChaCha20-Poly1305 with ECDHE or DHE.
- Send a long-lived
Strict-Transport-Securityheader and mark cookiesSecure,HttpOnlyandSameSite. - Turn on OCSP stapling and confirm revocation checks work.
- Keep private keys in an HSM or KMS, never in source control, and audit backups.
- Write down how keys are rotated and how a suspected compromise is revoked.
- Keep TLS error detail out of production responses.
- If TLS ends at a proxy or load balancer, encrypt the hop to the backend too (mTLS where possible).
- Make sure mobile and desktop clients validate chains and hostnames. Pin only with a recovery plan.
- Keep the TLS configuration in version control and enforce it with IaC or CI checks.
Incident response considerations
- Key or certificate compromise: generate new keys, on secure hardware if possible, revoke the old certificates and look for misuse.
- Suspected man-in-the-middle or downgrade: capture packets, collect TLS alerts and server logs, and line them up with authentication logs.
- Unexpected certificates: check CT logs and the issuing CA, then revoke and replace if needed.
- Keep packet captures, logs and config snapshots for analysis and any legal or compliance follow-up.
References
MITRE ATT&CK techniques
- T1557 - Adversary-in-the-Middle - TLS interception attacks
- T1040 - Network Sniffing - Cleartext traffic capture
- T1552.001 - Unsecured Credentials: Credentials In Files - Exposed keys/certs
- T1573 - Encrypted Channel - TLS misuse for C2
CWE entries
- CWE-326 - Inadequate Encryption Strength - Weak ciphers
- CWE-327 - Use of a Broken or Risky Cryptographic Algorithm - Deprecated protocols
- CWE-295 - Improper Certificate Validation - Certificate issues
Official documentation
- OWASP Transport Layer Security Cheat Sheet
- Mozilla TLS Configuration / HSTS guidance
- NIST SP 800-52 Rev. 2
Testing tools
Notable vulnerabilities
Server-Side Request Forgery (SSRF)
Exploiting SSRF for cloud metadata credentials, internal port scanning and Redis via gopher, with filter bypasses and blind SSRF over out-of-band callbacks.
Verbose Error Messages
What verbose error messages leak in production, how to spot them during testing, and how to turn them off.