Definition
Frame Counting
Frame counting is an XS-Leak that reads the number of
iframes a cross-origin page opens. Afterconst win = window.open('https://www.linkedin.com'), the attacker consultswin.lengthonce the page has loaded — a value that depends on the user’s logged-in state, because an authenticated page renders more frames. The count therefore leaks a bit of auth state.
SameSite=Lax does not stop this
window.openis a top-level navigation, andLaxcookies are attached to top-level cross-site navigations. So the cross-site page loads authenticated, the iframe count varies with auth state, and aLax-protected site still leaks. SameSite mitigates some XS-Leaks but not this one because the threat model — a boolean oracle, not a CSRF — does not require the attacker to forge a request, only to load the page.