# Skipped TLS peer and session trust checks

Conditional hostname checks, unbound OCSP responses, session reuse after failed verification, dual chain builders

_Area: Web authentication and account takeover. Seen in 5 disclosed reports; 2 confirmed bounties: $300 and $2,580; latest 2024-03-29. Updated 2026-10-23._

## How it works
A TLS client must confirm the peer before trusting it: the chain ends in a trusted root, the verified peer name equals the intended host, any OCSP response is bound to this exact cert, and any resumed session was authenticated for this exact vhost. The weakness is when one of those checks is skipped, gated on an unrelated condition, or split across code paths that never agree. The assumption that breaks is "the library enforces verification for me." In practice the enabling call is conditional, conflated with another feature, or duplicated so two validators disagree.

## Where it shows up
- Hostname-setting API called only when a DNS name exists, so IP peers skip CN/SAN checks [E2](https://bugbountylibrary.com/r/h1%3A2435482.md)
- Embedded webviews in desktop/mobile apps that accept self-signed or attacker-supplied certs [E4](https://bugbountylibrary.com/r/h1%3A903424.md)
- Two chain-building paths (custom issuer lookup vs. platform chain) with no equality check [E1](https://bugbountylibrary.com/r/blog%3Asector7-computest-nl-post-2022-07-opc-ua-net-standard-trusted-application-check-bypass.md)
- Chain-status checks that ignore UntrustedRoot or use case-insensitive/reordered DN matching [E1](https://bugbountylibrary.com/r/blog%3Asector7-computest-nl-post-2022-07-opc-ua-net-standard-trusted-application-check-bypass.md)
- OCSP response accepted without binding its serial to the peer cert [E3](https://bugbountylibrary.com/r/h1%3A1048457.md)
- Failed-verification paths that still populate the session cache [E5](https://bugbountylibrary.com/r/h1%3A2341063.md)

## How to review
The invariant: for every connection, the verified peer name equals the intended host, the chain terminates in a trusted root, the OCSP response is bound to this cert, and any resumed session was authenticated for this exact vhost/SNI. Check that the hostname-verification call is unconditional, not gated on SNI being non-NULL [E2](https://bugbountylibrary.com/r/h1%3A2435482.md); that webviews enable cert validation [E4](https://bugbountylibrary.com/r/h1%3A903424.md); that when two chain builders exist their results are compared and UntrustedRoot is fatal [E1](https://bugbountylibrary.com/r/blog%3Asector7-computest-nl-post-2022-07-opc-ua-net-standard-trusted-application-check-bypass.md); that OCSP CertID matches the peer serial [E3](https://bugbountylibrary.com/r/h1%3A1048457.md); and that failed verification never seeds the session cache [E5](https://bugbountylibrary.com/r/h1%3A2341063.md). Verify ticket keys are scoped per vhost.

## Variants seen
- Conditional hostname check skipped for IP peers in libcurl/mbedTLS [E2](https://bugbountylibrary.com/r/h1%3A2435482.md)
- Desktop registration webview skipping validation [E4](https://bugbountylibrary.com/r/h1%3A903424.md)
- Dual chain construction with no equality check, case-flipped root bypass [E1](https://bugbountylibrary.com/r/blog%3Asector7-computest-nl-post-2022-07-opc-ua-net-standard-trusted-application-check-bypass.md)
- OCSP response from same issuer accepted without serial match [E3](https://bugbountylibrary.com/r/h1%3A1048457.md)
- Session cache populated despite failed OCSP check, reused on later transfer [E5](https://bugbountylibrary.com/r/h1%3A2341063.md)

## Impact and severity
Led to OAuth token and auth-header capture [E4](https://bugbountylibrary.com/r/h1%3A903424.md), fake HTML/JS in a trusted window [E4](https://bugbountylibrary.com/r/h1%3A903424.md), trust-check bypass [E1](https://bugbountylibrary.com/r/blog%3Asector7-computest-nl-post-2022-07-opc-ua-net-standard-trusted-application-check-bypass.md), and revocation bypass [E3](https://bugbountylibrary.com/r/h1%3A1048457.md)[E5](https://bugbountylibrary.com/r/h1%3A2341063.md). Severity is high when the skipped check guards credentials or client authentication; worse when the client is a trusted app window or the endpoint carries reusable tokens.

## Evidence
- E1: https://bugbountylibrary.com/r/blog%3Asector7-computest-nl-post-2022-07-opc-ua-net-standard-trusted-application-check-bypass.md
- E2: https://bugbountylibrary.com/r/h1%3A2435482.md
- E3: https://bugbountylibrary.com/r/h1%3A1048457.md
- E4: https://bugbountylibrary.com/r/h1%3A903424.md
- E5: https://bugbountylibrary.com/r/h1%3A2341063.md
