helmetjs / helmet

Help secure Express apps with various HTTP headers

Home Page:https://helmetjs.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support `unsafe-none` in `helmet.crossOriginEmbedderPolicy`?

mxxk opened this issue Β· comments

@EvanHahn thanks for your continued work on this package. πŸ™Œ

I noticed that although unsafe-none is a valid value for Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy, and it is supported by helmet COOP,

export interface CrossOriginOpenerPolicyOptions {
policy?: "same-origin" | "same-origin-allow-popups" | "unsafe-none";
}
const ALLOWED_POLICIES = new Set([
"same-origin",
"same-origin-allow-popups",
"unsafe-none",
]);

but it is not supported by helmet COEP:

export interface CrossOriginEmbedderPolicyOptions {
policy?: "require-corp" | "credentialless";
}
const ALLOWED_POLICIES = new Set(["require-corp", "credentialless"]);

I was wondering if this seems right to you, and if not, I'm happy to submit a PR! I don't believe this would be a breaking change.

You're right. COEP should support "unsafe-none". Feel free to open a pull request!