Cross-Origin-Opener-Policy header is set
Why it matters
Without Cross-Origin-Opener-Policy, a cross-origin page that your app opens (or that opens your app) can hold a reference to your window object. Spectre-class speculative-execution attacks use cross-origin window references and shared memory to read data across origin boundaries. CWE-1021 (Improper Restriction of Rendered UI Layers / Frame Hijacking) applies. OWASP A05 (Security Misconfiguration) flags missing isolation headers as a configuration gap. The absence of COOP also prevents the browser from enabling SharedArrayBuffer and high-resolution timers, which are required for performant web workers in security-sensitive contexts.
Severity rationale
Medium because Spectre-class attacks require local code execution and specific browser conditions, but the window reference exposure is a prerequisite that is cheap to eliminate with a single header.
Remediation
Set Cross-Origin-Opener-Policy in your Next.js headers config. Use same-origin-allow-popups if your app opens OAuth flows or payment windows; use same-origin for maximum isolation.
// next.config.js
module.exports = {
async headers() {
return [{
source: '/(.*)',
headers: [{
key: 'Cross-Origin-Opener-Policy',
value: 'same-origin-allow-popups'
}]
}]
}
}
Verify OAuth popups still function after deploying — same-origin will break popup-based OAuth flows that communicate via window.opener. Switch to same-origin-allow-popups if you hit that issue.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Security Headers II Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-1021
- owasp:2021 · A05
- soc2:2017 · CC6.6 — Protection against threats from outside system boundaries
Taxons
History
- 2026-04-18·v1.0.0·Initial import from security-headers-ii·automated
- 2026-07-06·v1.0.1·Add SOC 2 TSC mapping (CC6.6) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2