
Content Security Policy (CSP)
Content Security Policy (CSP) is a security feature that helps websites prevent attacks like cross-site scripting (XSS) and data injection. It works by allowing website owners to specify which content sources are trusted, such as scripts, images, and stylesheets. When a browser visits a site with a CSP, it checks the policy and blocks any content that comes from unapproved sources. This reduces the risk of malicious content being loaded, helping to protect users' data and enhance overall web security. In essence, CSP acts like a set of rules that guide what is safe to load on a website.