Web Security · Senior · Question 53 of 75

A script from a CDN is included with <script src="https://cdn.example/lib@3.2.1.js">. What does adding integrity="sha384-..." protect against?

Explanation

Subresource Integrity works for versioned, immutable URLs. It requires CORS (crossorigin) for cross-origin scripts.

Further reading

Problem with a question

Web Security · Senior · question 53

Test yourself

Take the Web Security · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz