Skip to content
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

Dynamic Content Security Policy (CSP) Update with Helmet #473

Open
siirius99 opened this issue Sep 9, 2024 · 1 comment
Open

Dynamic Content Security Policy (CSP) Update with Helmet #473

siirius99 opened this issue Sep 9, 2024 · 1 comment

Comments

@siirius99
Copy link

siirius99 commented Sep 9, 2024

We are using Angular as the frontend and Node.js as the backend, both served on the same port. Helmet is being used to manage security headers, with a global configuration for most routes, and a specific configuration for one route where Content-Security-Policy (CSP) headers are dynamically set based on frame source URLs that are fetched from the database.

The problem arises when the frame source URLs in the database are updated. These updates do not reflect in the application until the app is manually refreshed, causing a break in functionality for any new URLs added to the frameSrc directive.

this.app.use('/route', (request, response, next) => { const frameSourceUrls = [myUrlsFromDatabase]; contentSecurityPolicy({ useDefaults: false, directives: { ...commonCSP, frameSrc: frameSourceUrls }, reportOnly: false })(request, response, next); }); Is there any way to solve it?

@siirius99 siirius99 changed the title Issue: Dynamic Content Security Policy (CSP) Update with Helmet Dynamic Content Security Policy (CSP) Update with Helmet Sep 9, 2024
@EvanHahn
Copy link
Member

EvanHahn commented Sep 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants