Safeguard
Application Security•

ASVS 5.0 V3.4.8: Set Cross-Origin-Opener-Policy on HTML Responses

ASVS V3.4.8 (Level 3) wants Cross-Origin-Opener-Policy same-origin or same-origin-allow-popups on every document response. Why it helps, how to set it, how to test.

Safeguard Security Team
2 min read

ASVS 5.0 requirement V3.4.8 says every HTTP response that starts a document render, such as text/html, must carry a Cross-Origin-Opener-Policy header with same-origin or, where needed, same-origin-allow-popups. It is a Level 3 requirement.

Why it matters

When your page opens another window, or is opened by one, the two can hold references to each other's window object. Another origin that gets such a reference can navigate your page (tabnabbing) or infer things about it, for example how many frames it contains. COOP puts your page in its own browsing context group, which cuts those links.

How to implement it

Cross-Origin-Opener-Policy: same-origin
add_header Cross-Origin-Opener-Policy "same-origin" always;
app.use(helmet.crossOriginOpenerPolicy({ policy: "same-origin" }));

Use same-origin-allow-popups if your page opens popups to other origins and needs to keep a reference, as in some payment or sign in flows. Expect same-origin to break window.opener flows, so test OAuth popups first.

How to test it

curl -sI https://app.example.com/ | grep -i cross-origin-opener-policy

Then open the site from a page on another origin using window.open and check that opener is null on your side.

Common mistakes

Setting it only on the homepage. Every HTML response needs it.

Breaking sign in popups. Pick the allow popups variant when required.

Forgetting noopener on links. Use rel="noopener" as well.

Quick check

Does COOP replace rel noopener?

No, they complement each other. COOP is set by the destination, noopener by the link.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.