-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content-Security-Policy getDefaultDirectives
should return a deep copy
#463
Labels
Milestone
Comments
Two things to note:
|
You could cause a problem if you mutate one of the arrays. For example: const one = getDefaultDirectives();
one["script-src"].push("https://garbage.example");
const two = getDefaultDirectives();
console.log(two["script-src"]);
// => ["'self'", "https://garbage.example"] |
EvanHahn
pushed a commit
that referenced
this issue
Apr 29, 2024
EvanHahn
pushed a commit
that referenced
this issue
May 25, 2024
EvanHahn
pushed a commit
that referenced
this issue
Jun 1, 2024
EvanHahn
pushed a commit
that referenced
this issue
Sep 28, 2024
EvanHahn
pushed a commit
that referenced
this issue
Sep 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
getDefaultDirectives
returns a shallow copy:helmet/middlewares/content-security-policy/index.ts
Line 71 in 6475da1
Someone could mutate this object and cause chaos. We should:
getDefaultDirectives
again.This is technically a breaking change so it should be made against the
v8.0.0
branch.The text was updated successfully, but these errors were encountered: