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

Idea: Add Integrity Request Header #123

Open
tetsuyainfra opened this issue Jun 29, 2024 · 1 comment
Open

Idea: Add Integrity Request Header #123

tetsuyainfra opened this issue Jun 29, 2024 · 1 comment

Comments

@tetsuyainfra
Copy link

Hello.
I recently learned of the polyfill.io malware issue.

Currently, SRI is supported in all major browsers.
Therefore, if the integrity attribute is specified correctly, it is possible to prevent the execution of malicious scripts on the client side.

I believe that this issue is cases where scripts for which the integrity attribute is not specified are later pollutioned.

If a server error could be returned when loading a script for which the integrity attribute is not specified, developers would have no choice but to specify the attribute in the HTML.

<script
  src="https://example.com/example-framework.js"
  integrity="sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC">
  </script>
GET /xample-framework.js
Integrity: sha384-Li9vy3DqF8tnTXuiaAJuML3ky+er10rcgNR/VqsVpcw+ThHmYcwiB1pbOxEbzJr7
...

HTTP/1.1 200 OK
...

It would be ineffective if the server cannot be trusted from the start, but I think the specification can be added without much impact.

Related:
https://lists.w3.org/Archives/Public/public-webappsec/2017Jun/0000.html

@mozfreddyb
Copy link
Collaborator

I think the same can be achieved with a CSP script-src directive, no?

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

No branches or pull requests

2 participants