Registry / security / Flask-Paranoid

Flask-Paranoid

JSON →
library0.3.0pypypi✓ verified 84d ago

A Flask extension that protects user sessions from being stolen by adding additional checks beyond the session ID, such as IP address and user agent validation. Current version 0.3.0, released in May 2022; maintained by Miguel Grinberg.

pip install flask-paranoid
INSTALL
IMPORT
SIG · FLASK-PARANOID
F
Flask-Paranoid
securitypythonv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Paranoid
from flask_paranoid import Paranoid
from flask_paranoid import FlaskParanoid
Extension class is named Paranoid, not FlaskParanoid

Basic initialization of Flask-Paranoid.

from flask import Flask from flask_paranoid import Paranoid app = Flask(__name__) app.secret_key = 'your-secret-key' Paranoid(app) @app.route('/') def index(): return 'Session protected' if __name__ == '__main__': app.run()
Debug
Known issues
gotchaParanoid uses the REMOTE_ADDR header to check IP; behind a reverse proxy, you must set app.wsgi_app = ProxyFix(app.wsgi_app) to get the real IP.
fix
Use werkzeug.middleware.proxy_fix.ProxyFix to fix IP detection.
affects: all
deprecatedVersion 0.3.0 is the latest; no updates since May 2022. The library is stable but may not receive future updates.
fix
Consider alternatives if newer Flask versions break compatibility.
affects: 0.3.0
gotchaParanoid's session protection checks occur on every request; if you allow session ID reuse via cookies (e.g., multiple tabs), it may log out users incorrectly.
fix
Understand that Paranoid adds strict checks; for multi-tab browsing, consider relaxing checks or using a different approach.
affects: all
Errors
Common errors & fixes
AttributeError: module 'flask_paranoid' has no attribute 'FlaskParanoid'
Wrong import class name. The correct class is Paranoid, not FlaskParanoid.
fix
from flask_paranoid import Paranoid
ImportError: cannot import name 'Paranoid' from 'flask_paranoid'
Package not installed or version mismatch; flask-paranoid must be installed.
fix
pip install flask-paranoid
Upgrade
Version history
0.3.0latest on PyPI · released Apr 2, 2022
Audit
Dependencies
FlaskrequiredRequired; integrates with Flask's session system
Agent activity
62 hits · last 30 days
node
50
Perplexity
1
OpenAI (training)
1
Resources