PyPI: django-mfa3

CVE-2022-24857

Safety vulnerability ID: SFTY-20220415-37162

Safety legacy ID: pyup.io-48171

Django-mfa3 0.5.0 includes a fix for CVE-2022-24857: Django-mfa3 is a library that implements multi factor authentication for the django web framework. It achieves this by modifying the regular login view. Django however has a second login view for its admin area. This second login view was not modified, so the multi factor authentication can be bypassed. Users are affected if they have activated both django-mfa3 (< 0.5.0) and django.contrib.admin and have not taken any other measures to prevent users from accessing the admin login view. It is possible to work around the issue by overwriting the admin login route, e.g. by adding the following URL definition before the admin routes: url('admin/login/', lambda request: redirect(settings.LOGIN_URL). https://github.com/xi/django-mfa3/security/advisories/GHSA-3r7g-wrpr-j5g4

Created at: May 21, 2026Updated at: May 21, 2026

Overview

Improper Authentication in django-mfa3

Advisory

Django-mfa3 0.5.0 includes a fix for CVE-2022-24857: Django-mfa3 is a library that implements multi factor authentication for the django web framework. It achieves this by modifying the regular login view. Django however has a second login view for its admin area. This second login view was not modified, so the multi factor authentication can be bypassed. Users are affected if they have activated both django-mfa3 (< 0.5.0) and django.contrib.admin and have not taken any other measures to prevent users from accessing the admin login view. It is possible to work around the issue by overwriting the admin login route, e.g. by adding the following URL definition before the admin routes: url('admin/login/', lambda request: redirect(settings.LOGIN_URL). https://github.com/xi/django-mfa3/security/advisories/GHSA-3r7g-wrpr-j5g4

Affected Package

Affecting django-mfa3 package, versions
<0.5.0

Also affects

---

How to Fix

Upgrade
django-mfa3
to
0.5.0
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more