
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
django-restricted-sessions
Advanced tools
.. image:: https://badge.fury.io/py/django-restricted-sessions.png :target: http://badge.fury.io/py/django-restricted-sessions
.. image:: https://travis-ci.org/mxsasha/django-restricted-sessions.png?branch=master :target: https://travis-ci.org/mxsasha/django-restricted-sessions
.. image:: https://coveralls.io/repos/mxsasha/django-restricted-sessions/badge.png?branch=master& :target: https://coveralls.io/r/mxsasha/django-restricted-sessions?branch=master
Restricts Django sessions to IP and/or user agent.
If the IP or user agent changes after creating the session, the a 400 response is given to the request, the session is flushed (all session data deleted, new session created) and a warning is logged. The goal of this middleware is to make it harder for an attacker to use a session ID they obtained. It does not make abuse of session IDs impossible.
For compatibility with IPv6 privacy extensions, by default only the first 64 bits of an IPv6 address are checked.
The full documentation is at https://django-restricted-sessions.readthedocs.org.
Install django-restricted-sessions::
pip install django-restricted-sessions
Then add it to your middleware after SessionMiddleware::
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
'restrictedsessions.middleware.RestrictedSessionsMiddleware',
....
]
If you use RESTRICTEDSESSIONS_AUTHED_ONLY
, ensure this middleware is added after
AuthenticationMiddleware
so that the request.user
is present.
0.4.0 (2023-06-02) ++++++++++++++++++
0.3.0 (2019-12-03) ++++++++++++++++++
X_FORWARDED_FOR
contains multiple addresses.0.2.0 (2017-04-06) ++++++++++++++++++
object
to django.utils.deprecation.MiddlewareMixin
travis.yml
for more Python versions0.1.4 (2016-07-02) ++++++++++++++++++
0.1.3.1 (2016-05-26) ++++++++++++++++++++
0.1.3 (2016-05-26) ++++++++++++++++++
0.1.2 (2014-03-20) ++++++++++++++++++
0.1.1 (2014-02-18) ++++++++++++++++++
0.1.0 (2014-02-17) ++++++++++++++++++
FAQs
Restrict Django sessions to IP and/or user agent.
We found that django-restricted-sessions demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.