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.
git clone --depth 1 https://github.com/ivangrynenko/cursorrulesWrote 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.
[](https://agentmods.dev/rules/ivangrynenko/cursorrules/python-broken-access-control)<a href="https://agentmods.dev/rules/ivangrynenko/cursorrules/python-broken-access-control"><img src="https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/python-broken-access-control/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.
<a href="https://agentmods.dev/rules/ivangrynenko/cursorrules/python-broken-access-control"><img src="https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/python-broken-access-control.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01829 |
| Opus 5.5 | $0.00000 | $0.00732 |
| Sonnet 5.5 | $0.00000 | $0.00366 |
| Haiku 4.5 | $0.00000 | $0.00183 |
Grade A, and why
python-broken-access-control 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 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.
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.
Copies of this mod
1 near-identical copy found in the catalogue:
- python-broken-access-control — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python Broken Access Control Security Standards (OWASP A01:2021)
This rule enforces security best practices to prevent broken access control vulnerabilities in Python applications, as defined in OWASP Top 10:2021-A01.
actions:
-
type: enforce conditions:
Pattern 1: Missing access control in Flask routes
- pattern: "@(app|blueprint)\.route\([^)]\)\s\n\sdef\s+[a-zA-Z0-9_]+\([^)]\):\s*(?![^#]*@login_required|[^#]*current_user\.|[^#]*session\[)" message: "Flask route lacks access control. Consider using @login_required or checking user permissions within the function."
Pattern 2: Missing access control in Django views
- pattern: "class\s+[A-Za-z0-9_]+View\((?!LoginRequiredMixin|PermissionRequiredMixin|UserPassesTestMixin)[^)]*\):" message: "Django class-based view lacks access control mixins. Consider using LoginRequiredMixin, PermissionRequiredMixin, or UserPassesTestMixin."
Pattern 3: Insecure direct object reference
- pattern: "(get|filter|find)_by_id\(\srequest\.(GET|POST|args|form|json)\[['"][^'"]+['"]\]\s\)" message: "Potential insecure direct object reference (IDOR). Validate that the current user has permission to access this object."
Pattern 4: Hardcoded role checks
- pattern: "if\s+user\.role\s*==\s*['"]admin['"]|if\s+user\.(is_staff|is_superuser)\s*:" message: "Hardcoded role checks can be fragile. Consider using a permission system or role-based access control framework."
Pattern 5: Missing authorization in FastAPI
- pattern: "@(app|router)\.([a-z]+)\([^)]\)\s\n\s*(?:async\s+)?def\s+[a-zA-Z0-9_]+\([^)]\):\s(?![^#]*Depends\(|[^#]*Security\(|[^#]*HTTPBearer\()" message: "FastAPI endpoint lacks security dependencies. Consider using Depends(get_current_user) or similar security dependencies."
Pattern 6: Bypassing access control with admin flags
- pattern: "if\s+request\.(GET|POST|args|form|json)\[['"]admin['"]\]|if\s+request\.(GET|POST|args|form|json)\[['"]debug['"]\]" message: "Dangerous admin/debug flags in request parameters could bypass access control. Remove or secure these backdoors."
Pattern 7: Insecure use of eval or exec with user input
- pattern: "eval\(|exec\(.*request\." message: "Extremely dangerous use of eval() or exec() with user input can lead to code execution. Avoid these functions entirely."
Pattern 8: Missing access control in API endpoints
- pattern: "@api_view\(|@api\.route\(|@app\.api_route\(" message: "API endpoint may lack access control. Ensure proper authentication and authorization checks are implemented."
Pattern 9: Insecure Flask session usage
- pattern: "session\[['"][^'"]+['"]\]\s*=\s*request\." message: "Setting session variables directly from request data without validation can lead to session-based access control bypasses."
Pattern 10: Missing CSRF protection
- pattern: "class\s+[A-Za-z0-9_]+Form\((?!.csrf).\):|@csrf_exempt" message: "Form or view appears to be missing CSRF protection. Ensure CSRF tokens are properly implemented."
-
type: suggest message: | Python Access Control Best Practices:
- Framework-Specific Controls:
- Django: Use built-in authentication and permission decorators/mixins
@login_required,LoginRequiredMixin@permission_required,PermissionRequiredMixinUserPassesTestMixinfor custom permission logic
- Flask: Use Flask-Login or similar extensions
@login_requireddecoratorcurrent_user.is_authenticatedchecks- Role-based access control with Flask-Principal
- FastAPI: Use dependency injection for security
Depends(get_current_user)pattern- OAuth2 with
Security(oauth2_scheme) - JWT validation middleware
- Django: Use built-in authentication and permission decorators/mixins
- Framework-Specific Controls:
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.
- 1mo ago First seen · 149 lines · 1,829 tokens per session scan A 534567c43798
python-broken-access-control 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 1,829 tokens. 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-09-03.
Other cursor rules, from other repositories
django
Django: models, views, ORM best practices.
python
Python best practices: type hints, pathlib, pytest, clean error handling.
pydantic
Pydantic: BaseModel, validators, Field, Settings.
pytest
You are an expert in pytest testing. Follow these rules.
pytorch
PyTorch: neural networks, model training, GPU optimization.
ruff
Ruff: linting, formatting, rule selection, configuration.