# Open Redirect - ID: python-open-redirect - Severity: MEDIUM - CWE: Open Redirect (CWE-601) - Languages: Python - Frameworks: flask, django, fastapi ## Description Detects unvalidated redirects using user input. ## Remediation Validate redirect URLs against an allowlist of permitted domains. ```python from urllib.parse import urlparse ALLOWED_DOMAINS = {"myapp.com"} if urlparse(url).netloc not in ALLOWED_DOMAINS: url = "/" ``` Learn more: https://shoulder.dev/learn/python/cwe-601/open-redirect ## Documentation [object Object] ## Related Rules - **Open Redirect** [MEDIUM]: - **Next.js Open Redirect** [MEDIUM]: - **Open Redirect via Untrusted URLs** [MEDIUM]: