CVE-2022-42731: Django mfa2 Django-mfa2 Vulnerable To MFA Replay Vulnerability
HIGHCVE-2022-42731 is a HIGH (CVSS 7.5) django-mfa2 vulnerable to mfa replay vulnerability (CWE-294: Authentication Bypass by Capture-replay) affecting Django mfa2 libraries in the PyPI ecosystem. The issue involves django-mfa2 vulnerable to mfa replay attack. Remediation is available by upgrading affected packages to version 2.5.1, 2.6.1.
CVE-2022-42731 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2022-42731
To remediate this vulnerability, upgrade all affected Django mfa2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install django-mfa2>=2.5.1
pip install django-mfa2>=2.6.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show django-mfa2
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-42731, inspect your installed packages using pip:
pip show django-mfa2
Analyze the terminal output to locate any version of Django mfa2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.5.1), your application is affected.
Note: The pip show django-mfa2 command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-294: Authentication Bypass by Capture-replay, where a capture-replay flaw exists when the design of the product makes it possible for a malicious user to sniff network traffic and bypass authentication by replaying it to the server in question to the same effect as the original message (or with minor changes). In Django mfa2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-42731 Affected Django mfa2 Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
django-mfa2
|
PyPI |
< 2.5.1
|
2.5.1
|
|
django-mfa2
|
PyPI |
≥ 2.6.0
< 2.6.1
|
2.6.1
|
References
Frequently Asked Questions
What is CVE-2022-42731?
Which Django mfa2 versions are affected?
What version fixes CVE-2022-42731?
Is django-mfa2 affected?
What is the CVSS score of CVE-2022-42731?
What CWE is associated with CVE-2022-42731?
How can I check PyPI dependencies for CVE-2022-42731?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vw39-2wj9-4q86",
"modified" : "2026-06-10T18:44:18Z",
"published" : "2022-10-11T19:00:29Z",
"aliases" : [ "CVE-2022-42731" ],
"summary" : "django-mfa2 vulnerable to MFA Replay attack",
"details" : "mfa/FIDO2.py in django-mfa2 before 2.5.1 and 2.6.x before 2.6.1 allows a replay attack that could be used to register another device for a user. The device registration challenge is not invalidated after usage.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "django-mfa2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.5.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "django-mfa2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.6.0"
}, {
"fixed" : "2.6.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-42731"
}, {
"type" : "WEB",
"url" : "https://github.com/mkalioby/django-mfa2/commit/54db5a513bcafa97a36e9f6dfa31d3c61fa8217b"
}, {
"type" : "WEB",
"url" : "https://github.com/mkalioby/django-mfa2/commit/5fbb505e98ecdd409330a5c336ad5ec49631b0db"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mkalioby/django-mfa2"
}, {
"type" : "WEB",
"url" : "https://github.com/mkalioby/django-mfa2/blob/0936ea253354dd95cb127f09d0efa31324caef27/mfa/FIDO2.py#L58"
}, {
"type" : "WEB",
"url" : "https://github.com/mkalioby/django-mfa2/releases/tag/v2.5.1-release"
}, {
"type" : "WEB",
"url" : "https://github.com/mkalioby/django-mfa2/releases/tag/v2.6.1-release"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/django-mfa2/PYSEC-2022-303.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-294" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-10-11T20:49:45Z",
"nvd_published_at" : "2022-10-11T14:15:00Z"
}
}