security-global-dangerous-flows

A security-testing rule for tracing untrusted input through an application to find dangerous behavior. Untrusted input includes data supplied by users or external systems, such as request parameters or uploaded files.

In plain words
What is it for?
Use it when testing implemented application logic and following user-controlled data through web routes, files, commands, network requests, or other system interactions.
Why use it?
It helps identify vulnerabilities such as command injection, server-side request forgery, path traversal, access-control failures, and other unsafe input handling.

Cursor rule for Cursor

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/adobe/aem-desktop/security-global-dangerous-flows
Clone the repo
git clone --depth 1 https://github.com/adobe/aem-desktop

Made for: Cursor.

Per session 15 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,892 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 3 findings. Scan, not verified.
Origin 98% copy Near-identical to another mod 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.00015 $0.01892
Opus 5 $0.00008 $0.00946
Sonnet 5 $0.00003 $0.00378
Haiku 4.5 $0.00002 $0.00189

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

Security

Grade B, and why

security-global-dangerous-flows scanned grade B with 3 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 2d 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.

Recursive force deletemediumDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

exec(`rm -rf ${userInput}`); // Unvalidated input = command injection

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

* `fetch()`, `axios.get()`, `requests.get()`, `urllib`, `http.get()`, etc.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

* `exec`, `spawn`, `system`, `popen`, `ProcessBuilder`, `subprocess.run`, etc.
Origin

This is a copy

98% identical to dangerous-flows — 4 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.cursor/rules/security-global/security-global-dangerous-flows.mdc · 257 lines

How it starts

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

Dangerous Flow Identification

A Dangerous Flow occurs when user input—or data derived from it—is used in a way that introduces vulnerabilities, undefined behavior, or unwanted system interactions. This can range from command injection, SSRF, and path traversal to logic bugs and broken access controls. The goal is to trace the lifecycle of untrusted inputs and assess whether their use is safe.


Starting the Session

  1. If the project is very large, you may ask the user for what specific flow he wishes to test or for where more specific area of the code he is interested in.

Example of Dangerous Flow in JavaScript

const express = require('express');
const fs = require('fs');
const app = express();

app.get('/read', (req, res) => {
  const filename = req.query.file; // User input
  fs.readFile(`/home/userdata/${filename}`, (err, data) => {  // Dangerous usage
    if (err) return res.status(500).send("Error reading file");
    res.send(data);
  });
});

Danger: This allows for Path Traversal (e.g., ?file=../../etc/passwd), enabling unauthorized file access.


Identifying User Inputs

  1. Web/Backend Projects

    • Look for where routes or API endpoints are defined (e.g., Express app.get(), Flask @app.route, FastAPI).
    • Search for request/response objects: req, res, request, ctx, etc.
  2. CLI/Native Applications

    • Look for process.argv, getopt, or direct stdin usage.
    • Watch for file input, env variables, user config, or interactive prompts.
  3. Persisted Inputs

    • Even if sanitized once, data stored in a DB, config, or file can be reused unsafely.
    • These create second-order injection risks.

Following the Flow

  1. Start Point Detection

    • Look for parameters from user input:

      • req.body, req.query, input(), prompt(), fs.readFileSync(userInput), etc.
    • Example:

      username = input("Enter username:")  # user input
      

Read the full file on GitHub · 257 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. 2d ago First seen · 257 lines · 15 tokens per session scan B c1d5ef612881

Subscribe to this mod's changes

security-global-dangerous-flows is a cursor rule published in the GitHub repository adobe/aem-desktop (2 stars, last pushed 7d ago), licensed Apache-2.0. It adds 15 tokens to every session and 1,892 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 3 findings (recursive force delete, makes network calls, runs shell commands). It is 98% identical to dangerous-flows, differing in 4 lines, and is treated as a copy.