Skip to content
Security·Intermediate·Conceptual·1 min read

What does Subresource Integrity (SRI) protect against?

Short interview answer

A compromised or malicious CDN serving altered content for a URL you trust. The browser hashes the fetched file and refuses to execute it if the hash doesn't match the integrity attribute, so a swapped script is blocked rather than silently run.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to Dependency and supply-chain security

Related questions