Skip to main content
miji.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.

Sep 6, 2026 / 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) and data injection attacks by restricting executable scripts, stylesheets, images, and other resources, and mitigates clickjacking through the frame-ancestors directive, which controls who may embed the page in a frame. 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. A policy applies to the document it is delivered with, so preview pages and interstitial warnings are governed by the shortener's own policy rather than the destination site's. The interaction to plan for runs the other way: if a preview page embeds the destination in a frame, that site's frame-ancestors directive can block it.

Was this article helpful?

Related Terms

CSP

Content Security Policy - an HTTP header that controls which resources a browser is allowed to load for a given page.

XSS

Short for Cross-Site Scripting. An attack technique that injects malicious scripts into web pages to steal users' information.

Clickjacking

An attack that tricks users into clicking on hidden elements by overlaying transparent frames on top of legitimate web pages.

X-Frame-Options

An HTTP response header that controls whether a browser should allow a page to be displayed in an iframe.

CORS

Cross-Origin Resource Sharing - a browser security mechanism that controls which domains can access resources from another domain.

Lazy Loading

An optimization technique that defers loading of resources until they are actually needed, significantly improving initial page load speed.

Related Articles

Short URL Security - Phishing Risks, Safe Sharing Practices, and Protection Guide

A comprehensive guide to short URL security. Understand phishing risks, malware distribution via shortened links, and best practices for safe sharing.

How Link Previews Work and Their Security Risks - Safe Operation of Short URLs

Explore the technical mechanisms behind link previews (OGP) generated by SNS and chat apps, and the security risks that arise through short URLs. Learn about preview spoofing attack techniques and defense strategies.

Short URL Phishing - How to Spot Scams and Protect Yourself from Malicious Links

Learn to identify phishing attacks that use short URLs. Covers 5 common scam patterns, URL preview tools, and practical defense strategies.

Put the terms to work

Shorten a URL for Free