csp-audit

Analyze Content-Security-Policy configurations for unsafe directives and bypass patterns.

83|8|Updated May 6, 2026
One-click install
npx skills add https://github.com/Q16G/aster --skill csp-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csp-audit
Source: https://github.com/Q16G/aster/tree/main/skills/code-audit/csp-audit
Command: npx skills add https://github.com/Q16G/aster --skill csp-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

CSP configurations can be misconfigured, allowing XSS and data exfiltration through bypasses. This skill analyzes existing CSP policies to identify unsafe directives, missing nonces, and weak baselines, enabling targeted fixes.

Core Features & Use Cases

  • CSP policy analysis: evaluate script-src, object-src, default-src for weaknesses and potential bypass vectors.
  • Policy hardening recommendations: propose nonce/hash usage, strict-dynamic, and SRI-like approaches for CSP where applicable.
  • Use Case: On a web project implementing CSP headers, run this skill to detect unsafe directives and bypass patterns and generate remediation steps.

Quick Start

Run this skill on a project with CSP headers to identify potential bypass risks and actionable fixes.

Frequently Asked Questions about csp-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit a Content-Security-Policy header for XSS bypass risks?

To audit a Content-Security-Policy header for XSS risks, analyze existing configurations to identify unsafe directives, missing nonces or hashes, and common bypass patterns in script-src and object-src. This evaluates your security posture and generates actionable remediation steps.

What is a CSP bypass and how does unsafe script-src configuration enable it?

A CSP bypass exploits weak script-src directives to execute unauthorized scripts. Misconfigured policies allowing unsafe-inline or missing strict-dynamic enable attackers to inject malicious code, bypassing intended restrictions and allowing potential data exfiltration.

How do I fix a weak Content-Security-Policy and implement nonces or hashes?

To fix a weak Content-Security-Policy, apply hardening recommendations by proposing nonce or hash usage and integrating strict-dynamic. This replaces unsafe-inline directives, mitigating common bypass vectors and establishing a stricter baseline for script execution.

Can I evaluate report-only mode and base-uri directives during a CSP security audit?

Yes, you can evaluate report-only modes and base-uri directives during a CSP security audit. The analysis assesses these configurations alongside default-src to identify missing nonces, weak baselines, and potential bypass opportunities for comprehensive compliance.

What are common limitations of Content-Security-Policy configurations against data exfiltration?

Limitations of Content-Security-Policy configurations against data exfiltration include overly permissive default-src settings and missing object-src restrictions. Without strict-dynamic and proper nonce implementation, weak baselines allow attackers to bypass policies and extract sensitive data.