XS-Leak (Cross-Site Leak)
A class of attacks that infer sensitive cross-origin information by exploiting browser side-channel behaviors like timing, error events, or frame counting.
XS-Leak (Cross-Site Leak) is a class of vulnerabilities that allow attackers to infer sensitive information about users by exploiting browser side-channel behaviors, timing differences, or observable events across origins.
How It Works
While Same-Origin Policy prevents direct reading of cross-origin responses, attackers can still detect characteristics like response size, load timing, redirect behavior, or error conditions. These side channels can leak information about a user's state or data on other sites.
Leaked Information Examples
- Whether a user is logged in to a service
- User's email or username on other sites
- Search results or query matches
- Social connections or group memberships
Prevention
- Cross-Origin-Opener-Policy (COOP):
same-originprevents cross-origin windows from retaining references - Cross-Origin-Resource-Policy (CORP):
same-originorsame-siteprevents cross-origin embedding - Cross-Origin-Embedder-Policy (COEP):
require-corpenforces CORP on all subresources - SameSite Cookies:
SameSite=Strictprevents cookies from being sent on cross-site requests - Fetch Metadata Headers: Use
Sec-Fetch-Site,Sec-Fetch-Modeto reject suspicious requests server-side - Cache-Control:
no-storeon sensitive responses prevents cache-based leaks - Framing Protection:
X-Frame-Options: DENYor CSPframe-ancestors 'none'