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.
npx agentmods add rules/abderrahimghazali/cursor-rules/python-cryptographic-failuresgit clone --depth 1 https://github.com/abderrahimghazali/cursor-rulesWhat 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 | $0.00000 | $0.02054 |
| Opus 5 | $0.00000 | $0.01027 |
| Sonnet 5 | $0.00000 | $0.00411 |
| Haiku 4.5 | $0.00000 | $0.00205 |
Grade A, and why
python-cryptographic-failures scanned grade A with 1 finding 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 yesterday.
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.
response = requests.get('https://example.com', verify=True) How it starts
The opening of the file, as written. The whole thing — 193 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python Cryptographic Failures Security Standards (OWASP A02:2021)
This rule enforces security best practices to prevent cryptographic failures in Python applications, as defined in OWASP Top 10:2021-A02.
actions:
-
type: enforce conditions:
Pattern 1: Weak or insecure cryptographic algorithms
- pattern: "import\s+(md5|sha1)|hashlib\.(md5|sha1)\(|Crypto\.Hash\.(MD5|SHA1)|cryptography\.hazmat\.primitives\.hashes\.(MD5|SHA1)" message: "Using weak hashing algorithms (MD5/SHA1). Use SHA-256 or stronger algorithms from the hashlib or cryptography packages."
Pattern 2: Hardcoded secrets/credentials
- pattern: "(password|secret|key|token|auth)\s*=\s*['"][^'"]+['"]" message: "Potential hardcoded credentials detected. Store secrets in environment variables or a secure vault."
Pattern 3: Insecure random number generation
- pattern: "random\.(random|randint|choice|sample)|import random" message: "Using Python's standard random module for security purposes. Use secrets module or cryptography.hazmat.primitives.asymmetric for cryptographic operations."
Pattern 4: Weak SSL/TLS configuration
- pattern: "ssl\.PROTOCOL_(SSLv2|SSLv3|TLSv1|TLSv1_1)|SSLContext\(\s*ssl\.PROTOCOL_(SSLv2|SSLv3|TLSv1|TLSv1_1)\)" message: "Using deprecated/insecure SSL/TLS protocol versions. Use TLS 1.2+ (ssl.PROTOCOL_TLS_CLIENT with minimum version set)."
Pattern 5: Missing certificate validation
- pattern: "verify\s*=\sFalse|check_hostname\s=\s*False|CERT_NONE" message: "SSL certificate validation is disabled. Always validate certificates in production environments."
Pattern 6: Insecure cipher usage
- pattern: "DES|RC4|Blowfish|ECB" message: "Using insecure encryption cipher or mode. Use AES with GCM or CBC mode with proper padding."
Pattern 7: Insufficient key length
- pattern: "RSA\([^,]+,\s*[0-9]+\s*\)|key_size\s*=\s*([0-9]|10[0-9][0-9]|11[0-9][0-9]|12[0-4][0-9])" message: "Using insufficient key length for asymmetric encryption. RSA keys should be at least 2048 bits, preferably 4096 bits."
Pattern 8: Insecure password hashing
- pattern: "\.encode\(['"]utf-?8['"]\)\.(digest|hexdigest)\(\)|hashlib\.[a-zA-Z0-9]+\([^)]*\)\.(digest|hexdigest)\(\)" message: "Using plain hashing for passwords. Use dedicated password hashing functions like bcrypt, Argon2, or PBKDF2."
Pattern 9: Missing salt in password hashing
- pattern: "pbkdf2_hmac\([^,]+,[^,]+,[^,]+,\s*[0-9]+\s*\)" message: "Ensure you're using a proper random salt with password hashing functions."
Pattern 10: Insecure cookie settings
- pattern: "set_cookie\([^)]secure\s=\sFalse|set_cookie\([^)]httponly\s=\sFalse" message: "Cookies with sensitive data should have secure and httponly flags enabled."
-
type: suggest message: | Python Cryptography Best Practices:
-
Secure Password Storage:
- Use dedicated password hashing algorithms:
import bcrypt hashed = bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt(rounds=12)) - Or use Argon2 (preferred) or PBKDF2 with sufficient iterations:
from argon2 import PasswordHasher ph = PasswordHasher() hash = ph.hash(password)
- Use dedicated password hashing algorithms:
-
Secure Random Number Generation:
- Use the
secretsmodule for cryptographic operations:import secrets token = secrets.token_hex(32) # 256 bits of randomness - For cryptographic keys, use proper key generation functions:
from cryptography.hazmat.primitives.asymmetric import rsa private_key = rsa.generate_private_key(public_exponent=65537, key_size=4096)
- Use the
-
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.
- yesterday First seen · 193 lines · 2,054 tokens per session scan A 9782dd4b1873
python-cryptographic-failures is a cursor rule published in the GitHub repository abderrahimghazali/cursor-rules (2 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,054 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
creating-cursor-rules
Meta-rule for creating effective Cursor IDE rules with best practices, patterns, and examples.
creating-skills
Meta-guide for creating effective Claude Code skills with proper structure, CSO optimization, and real examples.
cursorrules
You are a disciplined senior engineer working with someone who may be a domain expert, not a programmer. Build it correctly and safely, not just fast.
cursorrules
Cursor rule "cursorrules" from BlueBirdBack/godot-cursorrules, covering godot 4.4 game development .cursorrules, core development guidelines, code style, naming conventions and scene organization.
new_feature
You are an expert Product Owner and Technical Lead focused on helping users define and plan new features through collaborative discovery and structured documentation.
new_project
You are an expert Product Owner focused on helping users define new software projects through collaborative vision creation.