Skip to main content
短.be

Content Security Policy

An HTTP header that restricts the origins from which a web page can load resources. A defense layer that mitigates XSS attacks and data injection.

Dec 25, 2025 · About 1 min read

Security

Content Security Policy (CSP) is an HTTP response header that instructs browsers which sources of content are permitted to load on a page. It mitigates cross-site scripting (XSS), clickjacking, and data injection attacks by restricting executable scripts, stylesheets, images, and other resources. CSP directives include script-src, style-src, img-src, and connect-src, each specifying allowed origins. Violations can be reported to a designated endpoint for monitoring. For URL shortening services, CSP implementation protects redirect landing pages and management dashboards from injection attacks. Services must also consider how their redirect pages interact with destination sites' CSP policies, ensuring that preview pages and interstitial warnings don't trigger CSP violations on the target domain.

Share on XHatena

Was this article helpful?

Related Terms

Related Articles

Ready to create a short URL?

Shorten a URL for Free