content-security-policy

content-security-policy is a cursor rule for coding agents from atlassian/forge-skills. It costs 10 tokens per session (1,070 once invoked), scanned A, original, Apache-2.0.

A security rule for checking Forge app manifests, which are configuration files for Atlassian Forge apps, for unsafe Content Security Policy settings. Content Security Policy controls which scripts and styles a web app may load or run.

In plain words
What is it for?
Use it when reviewing Forge app permissions and manifests for risky script or style configuration.
Why use it?
It highlights settings such as unsafe inline code, code evaluation, or unrestricted sources that can make cross-site scripting attacks easier.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/atlassian/forge-skills/content-security-policy
Clone the repo
git clone --depth 1 https://github.com/atlassian/forge-skills

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for content-security-policy

README.md
[![agentmods](https://agentmods.dev/badge/rules/atlassian/forge-skills/content-security-policy.svg)](https://agentmods.dev/rules/atlassian/forge-skills/content-security-policy)
Your own site
<a href="https://agentmods.dev/rules/atlassian/forge-skills/content-security-policy"><img src="https://agentmods.dev/badge/rules/atlassian/forge-skills/content-security-policy.svg" alt="Measured on agentmods" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,070 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00010 $0.01070
Opus 5 $0.00005 $0.00535
Sonnet 5 $0.00002 $0.00214
Haiku 4.5 $0.00001 $0.00107

Measured 4d ago against content hash 7d004e7f02a0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

content-security-policy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/forge-security-review/assets/security-rules/forge-manifest-config/content-security-policy.mdc · 157 lines

How it starts

The opening of the file, as written. The whole thing — 157 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context

  • Forge Custom UI apps can configure CSP via permissions.content in manifest.yml. Unsafe directives like unsafe-inline and unsafe-eval enable XSS attacks.
  • Related CWE: CWE-16 (Configuration), CWE-79 (XSS via CSP bypass).
  • Only ~23% of Forge apps enable unsafe-inline; these require extra scrutiny.

Scope & Signals

  • Manifest location: permissions.content.scripts, permissions.content.styles.
  • Dangerous directives:
    • unsafe-inline - Allows inline <script> tags (XSS vector)
    • unsafe-eval - Allows eval(), Function(), etc.
    • Overly broad sources: *, https:
  • Note: Forge provides default CSP restrictions; apps opt out by adding these.

Vulnerable Patterns

# HIGH RISK - Both unsafe directives
permissions:
  content:
    scripts:
      - 'unsafe-inline'
      - 'unsafe-eval'

# HIGH RISK - unsafe-inline enables XSS
permissions:
  content:
    scripts:
      - 'unsafe-inline'

# HIGH RISK - unsafe-eval enables code injection
permissions:
  content:
    scripts:
      - 'unsafe-eval'

# HIGH RISK - Wildcard script sources
permissions:
  content:
    scripts:
      - '*'
      - 'https:'

# MEDIUM RISK - Broad CDN sources
permissions:
  content:
    scripts:
      - 'https://cdn.jsdelivr.net'  # Hosts arbitrary user content
      - 'https://unpkg.com'

Secure Patterns

# SECURE - Specific trusted sources only
permissions:
  content:
    scripts:
      - 'https://specific-cdn.example.com/lib.js'
    styles:
      - 'https://fonts.googleapis.com'

# SECURE - No unsafe directives (default)
permissions:
  content:
    styles:
      - 'https://fonts.googleapis.com'
# scripts section omitted = no additional script sources

# BEST - No content permissions needed
# Rely on bundled code, no external resources

Detection Checklist

  • Parse manifest.yml permissions.content section.
  • Flag unsafe-inline in scripts (enables XSS).
  • Flag unsafe-eval in scripts (enables code injection).
  • Check for wildcard or overly broad sources.
  • Verify external script sources are trustworthy and necessary.
  • Cross-reference with XSS findings (unsafe-inline + dangerouslySetInnerHTML).

Risk Assessment Matrix

Directive Risk Enables
unsafe-inline High XSS via inline scripts
unsafe-eval High Code injection via eval
* Critical Any external scripts
https: High Any HTTPS source
data: Medium Data URI scripts
Specific CDN Medium Depends on CDN content

Common Justifications (Assess Validity)

# "We need inline scripts for React"
# INVALID - React works fine without unsafe-inline
# Solution: Use bundled code, avoid inline event handlers

# "We use a charting library that requires eval"
# QUESTIONABLE - Modern libraries shouldn't require eval
# Solution: Find alternative library or update version

# "We dynamically load scripts"
# VALID USE CASE but needs scrutiny
# Solution: Use specific URLs, not wildcards

CDN Risk Assessment

# HIGH RISK CDNs (host user-uploaded content)
- 'https://cdn.jsdelivr.net'   # npm packages, user controlled
- 'https://unpkg.com'          # npm packages
- 'https://cdnjs.cloudflare.com'  # Generally trusted but broad

# If CDN is needed, prefer specific paths:
permissions:
  content:
    scripts:
      # Specific version and file
      - 'https://cdn.jsdelivr.net/npm/[email protected]/lodash.min.js'

PoC / Test Leads

  • If unsafe-inline present, check for dangerouslySetInnerHTML (XSS combo).
  • If unsafe-eval present, look for code injection sinks.
  • Test XSS payloads against apps with relaxed CSP.
  • Verify necessity of each external source.

Remediation Guidance (advisory)

  • Remove unsafe-inline: Bundle all JavaScript, avoid inline handlers.
  • Remove unsafe-eval: Update libraries, avoid dynamic code execution.
  • Replace wildcards with specific domains/paths.
  • Audit necessity of each external source.
  • Use subresource integrity (SRI) for external scripts where possible.
  • If unsafe-inline is truly required, document the justification and ensure no XSS sinks exist.

Read the full file on GitHub · 157 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 157 lines · 10 tokens per session scan A 7d004e7f02a0

Subscribe to this mod's changes

content-security-policy is a cursor rule published in the GitHub repository atlassian/forge-skills (20 stars, last pushed 4d ago), licensed Apache-2.0. It adds 10 tokens to every session and 1,070 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.