Performing Content Security Policy Bypass
Overview
Cybersecurity skill for performing content security policy bypass. Follows industry best practices and security standards.
When to Use
Trigger phrases:
"performing content security policy bypass"
"Analyze and bypass Content Security Policy implementations to achieve cross-site"
When XSS is found but execution is blocked by Content Security Policy
During web application security assessments to evaluate CSP effectiveness
When testing the robustness of CSP against known bypass techniques
During bug bounty hunting where CSP prevents direct XSS exploitation
When auditing CSP header configuration for security weaknesses
When NOT to Use
- When you lack proper authorization for testing
- For production systems without change management
- When the task requires legal or compliance expertise beyond technical scope
Prerequisites
- Burp Suite for intercepting responses and analyzing CSP headers
- CSP Evaluator (Google) for automated policy analysis
- Understanding of CSP directives (script-src, default-src, style-src, etc.)
- Knowledge of CSP bypass techniques (JSONP, base-uri, object-src)
- Browser developer tools for CSP violation monitoring
- Collection of whitelisted domain JSONP endpoints
Workflow
# Example: IOC detection
import re
IOC_PATTERNS = {
"ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",
"domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",
"hash_md5": r"\b[a-f0-9]{32}\b",
"hash_sha256": r"\b[a-f0-9]{64}\b",
}
def extract_iocs(text: str) -> dict:
return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}
- Plan Operations — Define objectives, scope, and success criteria for content security policy bypass operations.
- Prepare Environment — Set up tools, access, and data sources required for content security policy bypass.
- Execute Core Workflow — Perform the content security policy bypass operations following established procedures.
- Validate Results — Verify that results meet quality standards and objectives.
- Report Findings — Document results, observations, and recommendations.
- Follow Up — Track remediation actions and verify fixes where applicable.
Tools
- Analysis Platform — Data processing and visualization
- Collaboration Tools — Team coordination and knowledge sharing
Process
- Reconnaissance — Gather target information, identify attack surface, enumerate services
- Analysis/Exploitation — Execute the technique, analyze results, document findings
- Reporting — Document IOCs, write findings, provide remediation recommendations
Verification
Anti-Rationalization Table
| Rationalization |
Reality |
| "We are too small to be targeted" |
Automated attacks target everyone. Size does not matter. |
| "Security slows us down" |
A breach slows you down 100x more. Build security in from the start. |
| "We will fix it after launch" |
Vulnerabilities in production are exploited within hours. Fix before deploy. |
1---2name: performing-content-security-policy-bypass3description: Use when analyze and bypass Content Security Policy implementations to4 achieve cross-site scripting by exploiting misconfigurations, JSONP endpoints, unsafe5 directives, and policy injection techniques. Use when analyzeing and bypass content6 security policy implementations to achieve cross-site.7domain: cybersecurity8tags:9- csp-bypass10- content-security-policy11- xss12- script-injection13- nonce-bypass14- jsonp15- policy-misconfiguration16subdomain: web-application-security17version: '1.0'18author: oyi7719license: Apache-2.020nist_csf:21- PR.PS-0122- ID.RA-0123- PR.DS-1024- DE.CM-0125category: cybersecurity26metadata:27 source: https://skillmd.com/skills/oyi77/performing-content-security-policy-bypass28---2930# Performing Content Security Policy Bypass3132## Overview3334Cybersecurity skill for performing content security policy bypass. Follows industry best practices and security standards.3536## When to Use37**Trigger phrases:**38- "performing content security policy bypass"39- "Analyze and bypass Content Security Policy implementations to achieve cross-site"4041- When XSS is found but execution is blocked by Content Security Policy42- During web application security assessments to evaluate CSP effectiveness43- When testing the robustness of CSP against known bypass techniques44- During bug bounty hunting where CSP prevents direct XSS exploitation45- When auditing CSP header configuration for security weaknesses464748## When NOT to Use4950- When you lack proper authorization for testing51- For production systems without change management52- When the task requires legal or compliance expertise beyond technical scope535455## Prerequisites56- Burp Suite for intercepting responses and analyzing CSP headers57- CSP Evaluator (Google) for automated policy analysis58- Understanding of CSP directives (script-src, default-src, style-src, etc.)59- Knowledge of CSP bypass techniques (JSONP, base-uri, object-src)60- Browser developer tools for CSP violation monitoring61- Collection of whitelisted domain JSONP endpoints6263## Workflow6465```python66# Example: IOC detection67import re6869IOC_PATTERNS = {70 "ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",71 "domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",72 "hash_md5": r"\b[a-f0-9]{32}\b",73 "hash_sha256": r"\b[a-f0-9]{64}\b",74}7576def extract_iocs(text: str) -> dict:77 return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}78```79801. **Plan Operations** — Define objectives, scope, and success criteria for content security policy bypass operations.812. **Prepare Environment** — Set up tools, access, and data sources required for content security policy bypass.823. **Execute Core Workflow** — Perform the content security policy bypass operations following established procedures.834. **Validate Results** — Verify that results meet quality standards and objectives.845. **Report Findings** — Document results, observations, and recommendations.856. **Follow Up** — Track remediation actions and verify fixes where applicable.8687## Tools8889- **Analysis Platform** — Data processing and visualization90- **Collaboration Tools** — Team coordination and knowledge sharing919293## Process94951. **Reconnaissance** — Gather target information, identify attack surface, enumerate services961. **Analysis/Exploitation** — Execute the technique, analyze results, document findings971. **Reporting** — Document IOCs, write findings, provide remediation recommendations9899## Verification100101- [ ] All content security policy bypass procedures executed completely and documented102- [ ] Findings validated against multiple data sources103- [ ] False positives identified and filtered104- [ ] Results documented with evidence and timestamps105- [ ] Recommendations provided with risk-based prioritization106107## Anti-Rationalization Table108109| Rationalization | Reality |110|---|---|111| "We are too small to be targeted" | Automated attacks target everyone. Size does not matter. |112| "Security slows us down" | A breach slows you down 100x more. Build security in from the start. |113| "We will fix it after launch" | Vulnerabilities in production are exploited within hours. Fix before deploy. |