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

CSP Enhancement by removing unsafe-inline #1517

Closed
Schwitzd opened this issue May 18, 2024 · 5 comments
Closed

CSP Enhancement by removing unsafe-inline #1517

Schwitzd opened this issue May 18, 2024 · 5 comments
Labels
enhancement New feature or improvement

Comments

@Schwitzd
Copy link

Dear all,

I've added the CSP header to my Hugo site, but to render PaperMod correctly I'm forced to add the script-src 'unsafe-inline' directive.
Can you please consider removing inline JavaScript and style?

Many thanks

@Schwitzd Schwitzd added the enhancement New feature or improvement label May 18, 2024
@adityatelange
Copy link
Owner

Can you give me an example how an adversary would use inline scripts to compromise static sites?

@Schwitzd
Copy link
Author

Here you can find some examples: Do you use Content Security Policy with your Hugo site?

@adityatelange
Copy link
Owner

Here you can find some examples: Do you use Content Security Policy with your Hugo site?

I know CSP is a good way to prevent some attacks. If you are certain about the impact please let me know the entry points and attack paths available using inline-scripts.

@adityatelange adityatelange changed the title CSP Enhancement CSP Enhancement by removing unsafe-inline May 19, 2024
@Schwitzd
Copy link
Author

I'm using profile mode and when I remove `unsafe-inline' from my homepage I get the following errors:
Screenshot from 2024-05-19 13-23-08

@adityatelange
Copy link
Owner

alright, figure it out

@adityatelange adityatelange closed this as not planned Won't fix, can't repro, duplicate, stale May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
Development

No branches or pull requests

2 participants