Skip to content
cccskills
FreePublished on GitHubEnglish overview

content-security-policy

Review a website’s Content Security Policy, which controls allowed resources, and identify unsafe HTML insertion. Guide policy changes and sanitization, then verify actual HTTP responses and browser behavior in a production-like environment.

OriginalShow the original description

Use when reviewing headers, forms, cookies, or third-party integrations related to Implement a content security policy. Validate the effective browser and HTTP behavior in a production-like environment.

AI rating100/ 100See how to install

Good for

  • Reviewing an existing Content Security Policy
  • Restricting scripts and third-party resources
  • Checking how untrusted HTML is rendered
  • Testing policy changes before enforcement

Overview

What it does

content-security-policy reviews a website’s Content Security Policy (CSP) and helps correct it. CSP limits which resources may load or execute. The review covers HTTP headers and HTML insertion through operations such as innerHTML and dangerouslySetInnerHTML. It addresses restricting allowed sources, using nonces or hashes for inline scripts, and sanitizing HTML to remove unsafe content.

When it helps

Use it when reviewing settings after integrating an external service, or when organizing the conditions under which scripts can run on an existing site. It also supports introducing CSP gradually while reviewing violation reports. The work covers both resource restrictions and the handling of HTML inserted into a page.

Example requests

  • “Review this site’s CSP headers and identify settings that allow too many sources.”
  • “Check HTML insertion points and list where sanitization or Trusted Types is needed.”

Notes

CSP does not replace output encoding or sanitization. Begin with Content-Security-Policy-Report-Only to assess the effects before enforcement. Verify the actual HTTP responses and browser behavior in an environment similar to production.

This overview was written by AI (OpenAI Codex) from the public SKILL.md. Check the original below for the exact behavior.

Objective evaluation

AI rated this skill on four points using only the contents of its SKILL.md. Stars and popularity are not taken into account.

Clear instructionsIs it clear when to use it and what it does?
AGoodThe instructions explicitly cover CSP headers, HTML insertion points, and verification of actual browser behavior.
Concrete stepsAre steps, inputs, outputs, and examples spelled out?
AGoodThe material specifies Report-Only, nonces, hashes, insertion-point checks, and response verification.
SafetyAre sending data, deleting files, and running commands disclosed?
AGoodReport-Only testing before enforcement and response and behavior verification in a production-like environment are specified.
Easy setupDoes it need few tools or API keys, and are they documented?
AGoodNo API keys or specific operating systems are required, and the implementation reference is identified.

The total counts each point as A = 25, B = 15, C = 5. Rated by AI (OpenAI Codex) as of Oct 23, 2026. Treat it as a guide and read the original before installing.

Disagree? Request a re-evaluation

Tell us which point is wrong and why. No login needed. We will check it against the SKILL.md, redo the evaluation, and show the result here.

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

Files included (2)

  • SKILL.md2.4 KB
  • references/rule.md10.7 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Implement a content security policy

Content Security Policy prevents cross-site scripting (XSS), clickjacking, and data injection attacks by controlling which resources can be loaded and executed on your pages. It reduces blast radius, but it does not replace output encoding and sanitization.

Quick Reference

  • Start with Content-Security-Policy-Report-Only to test without breaking your site
  • Use nonces or hashes for inline scripts instead of unsafe-inline
  • Avoid unsafe-eval unless absolutely necessary
  • Set strict default-src then allow specific sources
  • Monitor CSP reports to catch violations
  • Sanitize untrusted HTML before rendering it into the DOM
  • Use Trusted Types in larger apps as defense in depth for DOM XSS sinks

Check

Check if this website implements a Content Security Policy header and analyze its directives. Also review any use of innerHTML, dangerouslySetInnerHTML, HTML template injection, and Trusted Types enforcement for large applications.

Fix

Implement a strict Content Security Policy to prevent XSS attacks and control resource loading. Sanitize untrusted HTML before rendering and add Trusted Types enforcement where the application has enough DOM injection surface to benefit from it.

Explain

Explain how CSP provides a security layer that helps detect and mitigate XSS and data injection attacks, and why sanitization is still required before rendering untrusted HTML.

Code Review

Review server config, headers, forms, and integration points related to Implement a content security policy. Flag exact responses, cookies, or browser behaviors that violate the rule, and verify them against the effective production-like response. Inspect HTML injection sinks and note whether Trusted Types or sanitization protects them.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/security/content-security-policy

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

404-page

FreeSummary

Create and review custom 404 pages that help visitors recover from broken or moved links through search and navigation. Check the rendered page and HTTP response so missing content returns a proper 404 status.

  • Creating a helpful custom 404 page
  • Adding search and navigation for broken links
  • Checking missing pages that return HTTP 200
thedaviddias/Front-End-Checklist74.5KUpdated Oct 6, 2026

about-page

FreeSummary

Audit or create a dedicated About page that explains a website’s purpose and identifies its people or organization. Review the rendered output and supporting information, including expertise and contact details, to find gaps.

  • Reviewing a website’s About page
  • Creating a page about the organization and its mission
  • Checking how operator information appears in rendered output
thedaviddias/Front-End-Checklist74.5KUpdated Oct 6, 2026

accessibility-testing

FreeSummaryAI rating 80

Review and add automated accessibility checks for components, pages, and continuous integration workflows. Use axe-based tools to detect structural and attribute issues, while identifying checks that still need keyboard or screen reader testing.

  • Review accessibility coverage for shared components
  • Add accessibility checks to page flow tests
  • Run accessibility tests in CI
thedaviddias/Front-End-Checklist74.5KUpdated Oct 6, 2026

Review sign-in, registration, multi-factor authentication, and account recovery for accessibility barriers. Find blocked paste, difficult code entry, and inaccessible backup methods, then suggest authentication paths that support password managers, autofill, or device approval.

  • Reviewing accessibility across the sign-in process
  • Checking verification code paste and autofill
  • Inspecting password reset and account recovery
thedaviddias/Front-End-Checklist74.5KUpdated Oct 6, 2026

Review form errors, success messages, and live updates so screen reader users receive important notifications. Check the HTML delivered to the browser, announcement settings, display duration, and dismissal controls, then identify specific elements that need changes.

  • Reviewing form error announcements
  • Checking success message display duration
  • Auditing live update notifications
thedaviddias/Front-End-Checklist74.5KUpdated Oct 6, 2026

Review HTML tables so screen reader users can understand how headers and data relate. Check header markup, table descriptions, and merged cells, then identify specific fixes and ways to verify them.

  • Reviewing tables for screen reader accessibility
  • Checking header relationships in tables with merged cells
  • Reviewing table patterns in a design system
thedaviddias/Front-End-Checklist74.5KUpdated Oct 6, 2026

See all skills by thedaviddias

Report a problem with this skill