11. How would you assess cross-site leaks through timing and observable window state?
An attacker cannot read an authenticated application's response, but can embed or open selected URLs and measure load timing, frame count, navigation behavior, cache state, or whether a popup closes. Identify the secret state being inferred, attacker capabilities, browser isolation boundary, and observable side channel. Design mitigations using response uniformity, state-changing protections, framing and opener controls, cache partitioning assumptions, cross-origin resource policies where applicable, and reduced distinguishability. Include test cases for logged-in versus logged-out resources, existence of a private document, cached versus uncached responses, blocked framing, and noisy timers. Explain residual risk without claiming CORS prevents information leaks caused by observable behavior.
I would model the leak as secret state plus an attacker-controlled cross-site action plus an observable difference. I would remove distinguishable responses, protect state changes, restrict frames and openers, avoid relying on cache isolation, apply relevant cross-origin policies, and test login, private-resource, cache, framing, and timing cases.
The attacker cannot directly see the private page, but they may still learn something by watching how the browser behaves. For example, a page may load faster, open differently, stay open, close, or behave differently when a person is signed in or owns a private item. The goal is to find which hidden fact can be guessed from those visible differences. Then we make those differences harder or impossible to observe, especially when they reveal whether a person is signed in, whether private content exists, or whether an action succeeded.
- Which secret states matter most: login status, private document existence, account membership, or another user-specific fact?
- Can the attacker embed the target in a frame, open it in a popup, navigate a window, or only load passive resources?
- Are state-changing endpoints in scope, or only read-only URLs?
- Which browsers and isolation features should I assume for the 2026 baseline?
- Can the application change server response behavior, cache policy, framing policy, and opener behavior?
I would start with a four-part threat model.
- Identify the secret state being inferred. The secret might be whether the victim is logged in, whether a private document exists, whether the victim has access to a resource, whether a message is present, or whether some user-specific state affects caching. I would name the exact bit of information the attacker wants to learn.
- Identify attacker capabilities. The attacker may control another origin and persuade the victim to visit it. From that page, the attacker may create an iframe, open a popup, navigate a window, load a cross-origin resource, or measure elapsed time and browser-visible events or state. The attacker still cannot directly read a protected cross-origin document because of the same-origin policy, but direct reading is not required for an XS-Leak.
- Identify the browser isolation boundary. The main boundary is the same-origin policy. It restricts one origin from reading another origin's DOM and many response details. CORS selectively grants cross-origin response-reading permission to certain APIs such as fetch. CORS is not a general defense against XS-Leaks, so I would never claim that CORS prevents timing, navigation, popup, framing, cache, or other leaks caused by observable behavior.
- Identify the observable side channel. I would enumerate only behavior the browser actually exposes to the attacker in the chosen attack primitive. Examples can include total operation timing, whether embedding is blocked, whether a window remains open or becomes closed, navigation behavior, load or error signals available for the particular resource type, and cache-dependent timing. I would not assume that arbitrary cross-origin DOM properties or detailed navigation state are readable. The important question is whether two secret states produce measurably different permitted observations.
From there, I would reduce distinguishability and unnecessary attacker capabilities.
Response uniformity is an important application-level control. For sensitive existence checks, I would avoid unnecessarily different externally observable paths for 'exists and authorized', 'exists but unauthorized', and 'does not exist' when that distinction itself is sensitive. The trusted server must still perform authorization for every request. Authentication tells us who the user is; authorization determines whether that user may access the resource. Where practical, unauthorized and nonexistent private resources should have similar status behavior, redirect behavior, response size, rendering work, and major backend processing so an attacker has fewer stable differences to measure. Perfect constant-time behavior is rarely realistic for a distributed web application, so the goal is to remove strong deterministic signals rather than promise mathematically identical timing.
For state-changing requests, I would prevent unauthorized cross-site triggering rather than merely hide the result. Use server-side CSRF protections appropriate to the application, such as SameSite cookie settings, unpredictable anti-CSRF tokens when needed, and Origin or Referer validation where appropriate. State-changing operations should use methods with correct HTTP semantics rather than GET. The trusted server must authenticate and authorize the request and fail safely. An information leak is more damaging if the attacker can also cause an action.
For framing, I would use the Content-Security-Policy frame-ancestors directive to restrict which origins may embed sensitive pages. X-Frame-Options can provide compatibility protection for older clients where required, but frame-ancestors is the modern, more expressive control. Blocking framing removes many iframe-based attack opportunities and also reduces clickjacking risk. I would test the denied case because differing frameability between secret-dependent endpoints can itself provide an observable distinction.
For windows and opener relationships, I would remove unnecessary relationships between an attacker-controlled page and a sensitive page. Links that open a new browsing context should use rel="noopener" when the opener is unnecessary. A programmatic window.open can request the noopener feature. Cross-Origin-Opener-Policy can provide stronger browsing-context-group isolation when the application can accept its compatibility effects. These controls reduce classes of attacks that rely on retaining a reference to a cross-origin popup and observing limited window state or navigation-related effects.
For cache-based leaks, I would not assume one global browser cache is shared equally across every site. Current browsers partition many caches and storage mechanisms by top-level site or other keys, which blocks or weakens many historical cross-site cache probes. However, the exact partition key and protected resource type vary across browser implementations and can evolve. I would therefore treat partitioning as defense in depth, not the application's security boundary. Sensitive personalized responses need deliberate Cache-Control behavior, and shared intermediaries must never serve authenticated content to the wrong user.
For cross-origin resource policies, I would apply a policy only when it matches the resource and threat. Cross-Origin-Resource-Policy can prevent certain no-cors cross-origin resource loads by requiring an allowed same-origin or same-site relationship. Cross-Origin-Embedder-Policy can be part of a stronger cross-origin-isolated deployment when the application needs it, but it has compatibility requirements and is not a universal XS-Leak fix. These headers should remove a specific attacker capability rather than be treated as a generic collection of security headers.
I would also remove secret-dependent window and navigation behavior. A popup should not close only when a secret condition is true if an untrusted opener can observe that difference. Avoid secret-dependent redirect chains, distinguishable navigation behavior, frame counts, or substantially different rendering and processing paths when those differences are observable across origins. The correct mitigation depends on the particular primitive, so I would first verify what the browser exposes instead of assuming every window property is available cross-origin.
Timer noise and reduced timer precision are useful defenses but are not sufficient by themselves. An attacker may repeat a measurement many times and use statistical analysis to recover a stable difference. Normal network noise also does not guarantee safety. The application should first remove large deterministic differences, then treat browser timer limitations as additional defense in depth.
I would verify the design with explicit paired tests.
For logged-in versus logged-out resources, I would repeatedly trigger the same target from an attacker origin in both states and compare only attacker-visible signals such as timing, permitted load or error behavior, redirect-related effects, popup state, and framing results. The expected result is that the attacker cannot reliably classify authentication state.
For private document existence, I would compare an identifier for an existing but unauthorized document with an identifier that does not exist. Authorization must deny access in both cases. I would look for differences in externally observable navigation behavior, redirects, major processing time, cache effects, framing behavior, or other signals exposed by the chosen primitive. The attacker should not gain a reliable document-existence oracle.
For cached versus uncached responses, I would test a cold state and an intentionally warmed state using the supported browser's real cache-partitioning behavior. I would confirm whether an attacker origin can observe any useful difference and verify that a cache hit cannot reveal user-specific private state. I would not claim safety solely because one browser currently partitions a particular cache.
For blocked framing, I would attempt to embed sensitive pages from an untrusted origin and verify that frame-ancestors prevents embedding. I would also verify that secret-dependent endpoints do not have inconsistent framing policies that expose a useful yes-or-no distinction.
For noisy timers, I would collect many samples for each secret state rather than comparing one measurement. I would compare their distributions under realistic browser, CPU, and network noise. If a practical classifier can still distinguish the states reliably, the signal is still useful to an attacker and the mitigation needs improvement.
Residual risk remains because some cross-origin interactions intentionally expose limited observable state, browsers change over time, network and processing behavior can remain statistically distinguishable, and repeated measurements can amplify small signals. The safest design minimizes secret-dependent observable differences, restricts unnecessary embedding and opener relationships, protects state-changing actions, enforces authorization on the trusted server, and tests supported browsers continuously. CORS should be described only as a mechanism that controls cross-origin response reading for applicable APIs, not as a guarantee against information leaks caused by observable behavior.
- Define the exact secret bit the attacker wants to infer.
- Enumerate attacker actions such as iframe embedding, popup opening, navigation, cross-origin resource loading, and repeated timing.
- State the browser isolation boundary, especially the same-origin policy, and identify what remains legally observable despite it.
- Build paired secret states and find deterministic differences in timing, redirects, framing, popup state, cache behavior, navigation, or resource events.
- Remove strong differences through response uniformity while preserving correct trusted-server authorization.
- Remove unnecessary attack primitives with CSRF protections, frame-ancestors, opener isolation, and relevant resource policies.
- Treat cache partitioning and timer noise as defense in depth rather than guarantees.
- Test logged-in versus logged-out, existing versus nonexistent private resources, cached versus uncached, allowed versus blocked framing, and repeated noisy timing samples.
- Reassess residual signals across supported browsers after application or browser changes.
The logic for one test is usually small, but reliable testing needs repeated measurements because browser, CPU, server, and network timing are noisy. If there are S secret-state pairs, V observable signals, B supported browsers, and R repetitions, the measurement work grows roughly with S × V × B × R. Memory use is normally small because the test only needs measurement samples and sanitized logs. Server cost can rise if sensitive response paths are made more uniform or if fast-path differences are removed. Operational cost includes maintaining authorization rules, CSRF defenses, security headers, cache policies, and browser regression tests. Maintenance is important because browser isolation, cache partitioning, and observable APIs can change.
This question tests whether the candidate understands that browser isolation can stop direct cross-origin reads while information can still leak through observable behavior. It evaluates threat modeling, same-origin policy limits, XS-Leak side channels, timing and cache reasoning, framing and opener defenses, server-side response design, protections for state-changing requests, browser privacy controls, and practical verification of residual risk.
A common mistake is saying that the same-origin policy or CORS prevents all cross-site information leaks. The same-origin policy blocks many direct reads, while CORS grants response-reading permission to selected origins for applicable APIs; neither statement means observable side channels disappear. Another mistake is measuring one request instead of repeated distributions. Candidates may also fail to identify the exact secret, attacker primitive, isolation boundary, and permitted observable signal. Other mistakes include relying only on timer noise, assuming all browser caches are partitioned identically, creating clearly different unauthorized and nonexistent paths, protecting reads while leaving state-changing requests vulnerable to CSRF, confusing authentication with authorization, applying framing controls without testing distinguishability, and retaining unnecessary opener relationships. Finally, do not promise perfect constant-time web responses or invent cross-origin observability that the browser does not expose.
Structure the answer as secret state, attacker capability, browser boundary, observable side channel, mitigation, and verification. Explicitly say that the same-origin policy can block direct reading while observable behavior can still leak information, and that CORS is not a general XS-Leak defense. Finish with paired tests and residual risk.









