Overview
This guide addresses common problems you might encounter while setting up, running, or testing the Auth Security Demo applications.Installation Issues
ModuleNotFoundError: No module named 'flask'
ModuleNotFoundError: No module named 'flask'
Permission denied when installing packages
Permission denied when installing packages
Python version not supported
Python version not supported
SSL certificate verification failed
SSL certificate verification failed
Database Issues
Database file not found or not created
Database file not found or not created
sqlite3.OperationalError: table users already exists
sqlite3.OperationalError: table users already exists
Database is locked
Database is locked
sqlite3.OperationalError: database is lockedCause: Another process is accessing the database.Solution:Application Runtime Issues
Address already in use (Port conflict)
Address already in use (Port conflict)
OSError: [Errno 98] Address already in useCause: Port 5000 or 5001 is already occupied.Solution:- Find and kill process
- Use different port
ImportError: cannot import name 'escape' from 'markupsafe'
ImportError: cannot import name 'escape' from 'markupsafe'
escape function.Solution:secure/app.py, change:CSRF token missing (secure app only)
CSRF token missing (secure app only)
- Via browser: The form should include
{{ csrf_token() }}in templates - Via curl/API: Include the CSRF token:
App starts but returns 404 for all routes
App starts but returns 404 for all routes
Session not persisting / constant logouts
Session not persisting / constant logouts
- Open DevTools (F12) → Application → Cookies
- Verify
sessioncookie exists for localhost - Try clearing cookies and logging in again
Testing Issues
SQL injection doesn't work
SQL injection doesn't work
Verify you're testing vulnerable app
Check terminal output
Try different payloads
admin' --(with space after —)' OR '1'='1(in password field)admin' OR 'a'='a(in username)
XSS payload displays as text instead of executing
XSS payload displays as text instead of executing
- Verify URL is http://localhost:5000 (vulnerable app)
- Check page source - vulnerable app shows:
<script>alert('XSS')</script> - Secure app shows:
<script>alert('XSS')</script>
- Check if template uses
{{ message | safe }}or{{ message }} - Should NOT have
| escapefilter in vulnerable version
IDOR doesn't allow viewing other profiles
IDOR doesn't allow viewing other profiles
?id= parameter doesn’t show other users.Solution:Ensure you're logged in
- Username:
usuario - Password:
password123
Verify you're on vulnerable app
Browser blocks XSS payloads
Browser blocks XSS payloads
- Disable XSS protection (temporarily)
- Use Firefox
- Alternative XSS payloads
Network and Access Issues
Cannot access app from another device
Cannot access app from another device
ERR_CONNECTION_REFUSED in browser
ERR_CONNECTION_REFUSED in browser
Slow response times or timeouts
Slow response times or timeouts
-
Database lock:
-
Too many connections:
-
Resource constraints:
-
Use Gunicorn for better performance:
Environment and Configuration
SECRET_KEY not found (secure app)
SECRET_KEY not found (secure app)
Environment variables not working
Environment variables not working
Debugging Tips
Getting Help
GitHub Issues
Documentation
Installation Guide
Testing Guide
Quick Diagnostics
Run this diagnostic script to check your setup:diagnose.sh, make executable (chmod +x diagnose.sh), and run (./diagnose.sh).