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 Hashes for Embedded <script> & <style> #16

Merged
merged 2 commits into from Jul 17, 2019
Merged

CSP Hashes for Embedded <script> & <style> #16

merged 2 commits into from Jul 17, 2019

Conversation

ankitpati
Copy link
Contributor

Calculate hashes for embedded <script> and <style> tags, for use with the script-src and style-src directives of the Content-Security-Policy HTTP header, to mitigate cross-site scripting (XSS) attacks.

This belongs here, and not in JS::Packer and CSS::Packer, because hashes are only relevant for embedded scripts and stylesheets. Scripts and stylesheets served separately can be whitelisted by path, which is much simpler and more performant than hashing.

I originally implemented this as a derived module, and ran into #15.

Calculate hashes for embedded `<script>` and `<style>` tags, for use
with the `script-src` and `style-src` directives of the
`Content-Security-Policy` HTTP header, to mitigate cross-site scripting
(XSS) attacks.

This belongs here, and not in `JS::Packer` and `CSS::Packer`, because
hashes are only relevant for embedded scripts and stylesheets. Scripts
and stylesheets served separately can be whitelisted by path, which is
much simpler and more performant than hashing.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling c1fac08 on ankitpati:csp-hashes into baea744 on leejo:master.

@leejo
Copy link
Owner

leejo commented Jul 17, 2019

Looks good 👍 - I'll get this pushed to CPAN shortly. Thanks again for the contribution.

@leejo leejo merged commit 9260b7b into leejo:master Jul 17, 2019
@ankitpati ankitpati deleted the csp-hashes branch July 17, 2019 13:57
@ankitpati
Copy link
Contributor Author

Thank you for the merge!

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

Successfully merging this pull request may close these issues.

None yet

3 participants