Skip to content

Securi-Tay 2017 - SSL/TLS Hipsterism: Finding implementation bugs outside the mainstream

Graeme Sutherland

Engineers explore architecture and security mechanisms for Securi-Tay 2017 - SSL/TLS Hipsterism: Finding implementation bugs outside the mainstream.

Summary

### Overview At Securi-Tay 2017, Graeme Sutherland (formerly of Portcullis, now Cisco) addressed the limitations of mainstream SSL/TLS testing tools during penetration testing and infrastructure assessments. While conventional security reviews routinely inspect supported TLS versions and cipher suites, they often overlook deeper implementation vulnerabilities, protocol logic flaws, and cryptographic subtleties. Sutherland introduced the rationale, architecture, and feature set of his custom Python-based tool, **ssl-xray** (formerly known as STCA), designed to detect contextual bugs and implementation errors beyond standard configuration scanning.

### Key Topics - **Deficiencies in Existing Tooling**: Established utilities possess notable drawbacks. Tools like `sslscan` rely on third-party OpenSSL libraries, causing them to silently fail at detecting SSLv2 if OpenSSL drops support. Tools like `ssl-cipher-suite-enum` use static, hardcoded raw binary packets captured in Wireshark, making them incapable of inspecting contextual protocol interactions or manipulating packet records prior to encryption. Meanwhile, network appliances (Nessus, Qualys) are bloated for specialized testing, and Qualys SSL Labs cannot assess internal networks and exposes target domains and test source IPs publicly. - **Implementation Quirks and Complexity**: Custom network implementations—such as routers, load balancers, and appliances handling Server Name Indication (SNI) routing—frequently harbor non-standard, flawed behavior. Cryptographic code is uniquely difficult to write securely, prone to edge cases, side-channels, and backwards compatibility baggage across iterations. - **Origin and Motivation**: The tool was inspired by an incident involving a PCI DSS compliance scan where a large scanner vendor flagged an F5 TLS issue (SOL6970 / TLS client finished message validation vulnerability). After a dubious clarification claimed it was a false positive, Sutherland recognized the necessity of independent verification tooling to prove whether specific TLS implementation bugs truly exist.

### Technical Details To avoid compilation issues and cross-platform hurdles across Windows, macOS, and Linux, Sutherland built `ssl-xray` in pure Python on top of an open-source library, `tls-lite` (and its maintained fork `tlslite-ng`), originally created by Trevor Perrin. This allows direct programmatic manipulation of TLS handshakes and records. Key capabilities include: - **Cipher Suite and Feature Probing**: Enumerating standard and proprietary or unknown cipher suites (including draft TLS 1.3 specs), checking supported elliptic curves, and detecting extensions like NPN (Next Protocol Negotiation) and ALPN (Application-Layer Protocol Negotiation). - **TLS Fallback SCSV Detection**: Simulating downgrade attacks to ensure the server correctly terminates downgraded connections using the `TLS_FALLBACK_SCSV` pseudo-cipher suite when a higher version is supported. - **Server Random Entropy Analysis**: Aggregating thousands of server random values (defaulting to around 10,000 handshakes) to evaluate statistical randomness through repetition detection, zlib compression testing, arithmetic mean, serial correlation, and monobit frequency tests. This catches severe real-world bugs, such as load balancers reusing static random values within one-second intervals. - **MAC Bit Validation**: Systematically flipping bits (via XOR masks) in the `verify_data` / MAC field across connections (such as the fixed 96-bit MAC in TLS 1.1 or variable-length MACs in TLS 1.2) before encryption to verify whether servers fail fatally upon receiving corrupted MACs, guarding against flaws where MAC verification is partial or absent.

### Takeaways Standard scanning tools provide an incomplete picture of TLS security by focusing primarily on enabled cipher suites while ignoring protocol validation quirks and entropy bugs. Utilizing extensible, pure-language protocol engines like `tls-lite` enables testers to reliably audit corner cases, check downgrade resistance, evaluate entropy, and validate MAC checks across cross-platform environments.

Related talks