python-ssrf

python-ssrf is a cursor rule for Cursor from ivangrynenko/cursorrules. It costs 0 tokens per session (5,124 once invoked), scanned A, original, MIT.

A set of checks for Python code that sends HTTP requests using URLs or connection details influenced by users. Server-side request forgery, or SSRF, tricks a server into making requests to unintended internal or external destinations.

In plain words
What is it for?
Use it to review requests, urllib, and http.client calls that use request parameters, form data, JSON, or other user-controlled values.
Why use it?
It helps prevent attackers from using your application to reach private services or other destinations that should not be accessible.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to review requests, urllib, and http.client calls that use request parameters, form data, JSON, or other user-controlled values.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/ivangrynenko/cursorrules/python-ssrf
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/ivangrynenko/cursorrules

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 python-ssrf

README.md
[![agentmods](https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/python-ssrf/github.svg)](https://agentmods.dev/rules/ivangrynenko/cursorrules/python-ssrf)
Your own site
<a href="https://agentmods.dev/rules/ivangrynenko/cursorrules/python-ssrf"><img src="https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/python-ssrf/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for python-ssrf

Your own site · 80×15
<a href="https://agentmods.dev/rules/ivangrynenko/cursorrules/python-ssrf"><img src="https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/python-ssrf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 5,124 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 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.00000 $0.05124
Opus 5.5 $0.00000 $0.02050
Sonnet 5.5 $0.00000 $0.01025
Haiku 4.5 $0.00000 $0.00512

Measured 1mo ago against content hash 530902b85b21, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

python-ssrf scanned grade A with 2 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 1mo 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.

Makes network callslowCapability

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

# Pattern 2: Detect urllib usage with user input

Runs shell commandslowCapability

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

# Pattern 8: Detect os.system calls with user input that might lead to SSRF
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.cursor/rules/python-ssrf.mdc · 520 lines

How it starts

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

Python Server-Side Request Forgery (SSRF) Standards (OWASP A10:2021)

This rule enforces security best practices to prevent Server-Side Request Forgery (SSRF) vulnerabilities in Python applications, as defined in OWASP Top 10:2021-A10.

actions:

  • type: enforce conditions:

    Pattern 1: Detect direct use of requests library with user input

    • pattern: "requests\.(get|post|put|delete|head|options|patch)\([^)]*?\b(request\.\w+|params\[\'[^\']+\'\]|data\[\'[^\']+\'\]|json\[\'[^\']+\'\]|args\.get|form\.get)" message: "Potential SSRF vulnerability detected. User-controlled input is being used directly in HTTP requests. Implement URL validation and allowlisting."

    Pattern 2: Detect urllib usage with user input

    • pattern: "urllib\.(request|parse)\.\w+\([^)]*?\b(request\.\w+|params\[\'[^\']+\'\]|data\[\'[^\']+\'\]|json\[\'[^\']+\'\]|args\.get|form\.get)" message: "Potential SSRF vulnerability detected. User-controlled input is being used directly in urllib functions. Implement URL validation and allowlisting."

    Pattern 3: Detect http.client usage with user input

    • pattern: "http\.client\.\w+\([^)]*?\b(request\.\w+|params\[\'[^\']+\'\]|data\[\'[^\']+\'\]|json\[\'[^\']+\'\]|args\.get|form\.get)" message: "Potential SSRF vulnerability detected. User-controlled input is being used directly in http.client functions. Implement URL validation and allowlisting."

    Pattern 4: Detect aiohttp usage with user input

    • pattern: "aiohttp\.\w+\([^)]*?\b(request\.\w+|params\[\'[^\']+\'\]|data\[\'[^\']+\'\]|json\[\'[^\']+\'\]|args\.get|form\.get)" message: "Potential SSRF vulnerability detected. User-controlled input is being used directly in aiohttp functions. Implement URL validation and allowlisting."

    Pattern 5: Detect httpx usage with user input

    • pattern: "httpx\.\w+\([^)]*?\b(request\.\w+|params\[\'[^\']+\'\]|data\[\'[^\']+\'\]|json\[\'[^\']+\'\]|args\.get|form\.get)" message: "Potential SSRF vulnerability detected. User-controlled input is being used directly in httpx functions. Implement URL validation and allowlisting."

    Pattern 6: Detect pycurl usage with user input

    • pattern: "pycurl\.\w+\([^)]*?\b(request\.\w+|params\[\'[^\']+\'\]|data\[\'[^\']+\'\]|json\[\'[^\']+\'\]|args\.get|form\.get)" message: "Potential SSRF vulnerability detected. User-controlled input is being used directly in pycurl functions. Implement URL validation and allowlisting."

    Pattern 7: Detect subprocess calls with user input that might lead to SSRF

    • pattern: "subprocess\.(Popen|call|run|check_output|check_call)\([^)]*?\b(request\.\w+|params\[\'[^\']+\'\]|data\[\'[^\']+\'\]|json\[\'[^\']+\'\]|args\.get|form\.get)" message: "Potential SSRF vulnerability detected. User-controlled input is being used in subprocess calls, which might lead to SSRF. Validate and sanitize input."

    Pattern 8: Detect os.system calls with user input that might lead to SSRF

    • pattern: "os\.(system|popen|spawn)\([^)]*?\b(request\.\w+|params\[\'[^\']+\'\]|data\[\'[^\']+\'\]|json\[\'[^\']+\'\]|args\.get|form\.get)" message: "Potential SSRF vulnerability detected. User-controlled input is being used in OS commands, which might lead to SSRF. Validate and sanitize input."

    Pattern 9: Detect URL construction with user input

    • pattern: "(f|r)["']https?://[^"']?\{[^\}]?\b(request\.\w+|params\[\'[^\']+\'\]|data\[\'[^\']+\'\]|json\[\'[^\']+\'\]|args\.get|form\.get)" message: "Potential SSRF vulnerability detected. User-controlled input is being used in URL construction. Implement URL validation and allowlisting."

Read the full file on GitHub · 520 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. 1mo ago First seen · 520 lines · 5,124 tokens per session scan A 530902b85b21

Subscribe to this mod's changes

python-ssrf is a cursor rule published in the GitHub repository ivangrynenko/cursorrules (88 stars, last pushed 11mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 5,124 tokens. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.