CVE-2020-5240: Wagtail 2fa 2FA Bypass Through Deleting Devices Vulnerability

MODERATE
Advisory Identifier: GHSA-9gjv-6qq6-v7qm
CVSS 7.6
CWE-285
Published
Advisory Summary

CVE-2020-5240 is a MODERATE (CVSS 7.6) 2fa bypass through deleting devices vulnerability (CWE-285: Improper Authorization) affecting Wagtail 2fa libraries in the PyPI ecosystem. The issue involves 2fa bypass through deleting devices in wagtail-2fa. Remediation is available by upgrading affected packages to version 1.4.1.

CVE-2020-5240 at a Glance

CVE Identifier CVE-2020-5240
GHSA Identifier GHSA-9gjv-6qq6-v7qm
Severity MODERATE
CVSS v3.1 Base Score 7.6
CWE Classification CWE-285: Improper Authorization
Affected Product Wagtail 2fa
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2020-5240

To remediate this vulnerability, upgrade all affected Wagtail 2fa dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

wagtail-2fa fixed: 1.4.1
pip install wagtail-2fa>=1.4.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 wagtail-2fa

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2020-5240, inspect your installed packages using pip:

pip show wagtail-2fa

Analyze the terminal output to locate any version of Wagtail 2fa in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.1), your application is affected.

Note: The pip show wagtail-2fa command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-285: Improper Authorization, where the product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action. In Wagtail 2fa, 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

### Impact Any user with access to the CMS can view and delete other users' 2FA devices by going to the correct path. The user does not require special permissions in order to do so. By deleting the other user's device they can disable the target user's 2FA devices and potentially compromise the account if they figure out their password. ### Patches The problem has been patched in version 1.4.1. ### Workarounds There is no workaround for this issue. ### For more information If you have any questions or comments about this advisory: * Open an issue in [github.com/labd/wagtail-2fa](https://github.com/labd/wagtail-2fa) * Email us at [security@labdigital.nl](mailto:security@labdigital.nl)

CVE-2020-5240 Affected Wagtail 2fa Versions

1 component(s)
Fixed Versions:
1.4.1
Product / Package Ecosystem Affected Versions Fixed Version
wagtail-2fa
PyPI
< 1.4.1
1.4.1

References

Frequently Asked Questions

What is CVE-2020-5240?
CVE-2020-5240 is a security vulnerability in Wagtail 2fa involving 2FA bypass through deleting devices in wagtail-2fa under CWE-285: Improper Authorization.
Which Wagtail 2fa versions are affected?
Affected versions include releases prior to 1.4.1 across affected packages: wagtail-2fa.
What version fixes CVE-2020-5240?
Upgrading to 1.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is wagtail-2fa affected?
Yes, wagtail-2fa is affected in releases prior to 1.4.1. Upgrade your dependency to 1.4.1 or later.
What is the CVSS score of CVE-2020-5240?
CVE-2020-5240 has a CVSS v3.1 base score of 7.6 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:H/A:N.
What CWE is associated with CVE-2020-5240?
CVE-2020-5240 is classified under CWE-285: Improper Authorization (The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.).
How can I check PyPI dependencies for CVE-2020-5240?
Run the dependency tree command: 'pip show wagtail-2fa'. 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-9gjv-6qq6-v7qm",
  "modified" : "2024-11-19T15:35:10Z",
  "published" : "2020-03-13T21:18:55Z",
  "aliases" : [ "CVE-2020-5240" ],
  "summary" : "2FA bypass through deleting devices in wagtail-2fa",
  "details" : "### Impact\nAny user with access to the CMS can view and delete other users&#39; 2FA devices by going to the correct path. The user does not require special permissions in order to do so. By deleting the other user&#39;s device they can disable the target user&#39;s 2FA devices and potentially compromise the account if they figure out their password.\n\n### Patches\nThe problem has been patched in version 1.4.1.\n\n### Workarounds\nThere is no workaround for this issue.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [github.com/labd/wagtail-2fa](https://github.com/labd/wagtail-2fa)\n* Email us at [security@labdigital.nl](mailto:security@labdigital.nl)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:H/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "wagtail-2fa"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/labd/wagtail-2fa/security/advisories/GHSA-9gjv-6qq6-v7qm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-5240"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/labd/wagtail-2fa/commit/ac23550d33b7436e90e3beea904647907eba5b74"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/labd/wagtail-2fa"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/wagtail-2fa/PYSEC-2020-219.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-285" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-03-13T21:18:19Z",
    "nvd_published_at" : null
  }
}