Vulnerabilities in pkg:pypi/django-mfa2

PACKAGE
Advisory Identifier: GHSA-vw39-2wj9-4q86
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/django-mfa2

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/django-mfa2. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-vw39-2wj9-4q86 CVE-2022-42731 HIGH django-mfa2 vulnerable to MFA Replay attack

CVE-2022-42731 at a Glance

CVE Identifier CVE-2022-42731
GHSA Identifier GHSA-vw39-2wj9-4q86
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-294: Authentication Bypass by Capture-replay
Affected Product Django mfa2
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (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.

django-mfa2 fixed: 2.5.1
pip install django-mfa2>=2.5.1
django-mfa2 fixed: 2.6.1
pip install django-mfa2>=2.6.1
Verify Direct and Transitive Dependencies

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

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.

CVE-2022-42731 Affected Django mfa2 Versions

2 component(s)
Fixed Versions:
2.5.12.6.1
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?
CVE-2022-42731 is a security vulnerability in Django mfa2 involving django-mfa2 vulnerable to MFA Replay attack under CWE-294: Authentication Bypass by Capture-replay.
Which Django mfa2 versions are affected?
Affected versions include releases prior to 2.5.1, 2.6.1 across affected packages: django-mfa2.
What version fixes CVE-2022-42731?
Upgrading to 2.5.1, 2.6.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is django-mfa2 affected?
Yes, django-mfa2 is affected in releases prior to 2.5.1, 2.6.1. Upgrade your dependency to 2.5.1, 2.6.1 or later.
What is the CVSS score of CVE-2022-42731?
CVE-2022-42731 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2022-42731?
CVE-2022-42731 is classified under CWE-294: Authentication Bypass by Capture-replay (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).).
How can I check PyPI dependencies for CVE-2022-42731?
Run the dependency tree command: 'pip show django-mfa2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}