Course contentsShow
← Security
Lesson 1101 of 3,05223. Web Security - Modern Web AttacksFree lesson

HTTP/2 Connection Coalescing Attacks

Exploiting connection reuse across origins, certificate validation bypasses, and connection coalescing security boundaries.

HTTP/2 Connection Coalescing Attacks

You'll learn how HTTP/2's connection reuse feature can be exploited to bypass security boundaries between different origins.

What Is Connection Coalescing?

HTTP/2 allows browsers to reuse a single TCP connection for multiple domains—a performance optimization called connection coalescing. If example.com and api.example.com both resolve to the same IP address and share a valid TLS certificate, the browser may send requests for both over one connection.

Think of it like carpooling: if two neighbors work at the same office building, they share one ride. Efficient—but what if one neighbor sneaks into the other's office?

The Attack Surface

Certificate validation bypasses: An attacker controlling one domain on a shared IP can potentially intercept or influence traffic meant for another domain if the certificate's Subject Alternative Name (SAN) includes both. Even with proper certificates, subtle validation flaws can be exploited.

Security boundary violations: Coalescing treats domains as equivalent when they share infrastructure. Sensitive cookies, authentication tokens, or headers meant for secure.bank.com might leak to marketing.bank.com if both coalesce over the same connection—especially if application logic assumes origin isolation.

Exploitation scenarios:

  • Attacker registers attacker.shared-cdn.com on a CDN shared with victim.shared-cdn.com
  • Both domains coalesce
  • Attacker's malicious JavaScript or service worker intercepts victim's API calls

Defense Strategies

  • Use separate IP addresses for security-critical domains
  • Implement strict certificate pinning
  • Monitor for unexpected connection coalescing behavior
  • Apply proper CORS and authentication checks server-side (never rely solely on origin separation)

Key Takeaway: HTTP/2 connection coalescing can blur origin boundaries, allowing attackers to exploit shared infrastructure and certificates to intercept or manipulate cross-domain traffic that should remain isolated.