# CVE-2020-15105: In Django Two-Factor Authentication, user passwords are stored in clear text in the Django session

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.4
- **CVSS:** 5.4 (v3.1, CNA) `CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:L/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: High; Privileges required: Low; User interaction: Required; Scope: Unchanged; Confidentiality impact: High; Integrity impact: Low; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, login needed
- **EPSS:** 0.70% (percentile 49, 2026-11-26)
- **CWE:** CWE-312
- **Aliases:** GHSA-vhr6-pvjm-9qwf, PYSEC-2020-39
- **Published:** 2020-07-10T20:55:00.000Z
- **Modified:** 2026-09-10T03:48:48.538Z

## Who should check

- Projects that depend on PyPI package django-two-factor-auth (\< 1.12)
- Anyone running Bouke django-two-factor-auth \< 1.12

## Description

Django Two-Factor Authentication before 1.12, stores the user's password in clear text in the user session (base64-encoded). The password is stored in the session when the user submits their username and password, and is removed once they complete authentication by entering a two-factor authentication code. This means that the password is stored in clear text in the session for an arbitrary amount of time, and potentially forever if the user begins the login process by entering their username and password and then leaves before entering their two-factor authentication code. The severity of this issue depends on which type of session storage you have configured: in the worst case, if you're using Django's default database session storage, then users' passwords are stored in clear text in your database. In the best case, if you're using Django's signed cookie session, then users' passwords are only stored in clear text within their browser's cookie store. In the common case of using Django's cache session store, the users' passwords are stored in clear text in whatever cache storage you have configured (typically Memcached or Redis). This has been fixed in 1.12. After upgrading, users should be sure to delete any clear text passwords that have been stored. For example, if you're using the database session backend, you'll likely want to delete any session record from the database and purge that data from any database backups or replicas. In addition, affected organizations who have suffered a database breach while using an affected version should inform their users that their clear text passwords have been compromised. All organizations should encourage users whose passwords were insecurely stored to change these passwords on any sites where they were used. As a workaround, wwitching Django's session storage to use signed cookies instead of the database or cache lessens the impact of this issue, but should not be done without a thorough understanding of the security tradeoffs of using signed cookies rather than a server-side session storage. There is no way to fully mitigate the issue without upgrading.

## Affected and fixed versions

- PyPI `django-two-factor-auth`: affected \< 1.12; fixed 1.12 (osv)
- Bouke django-two-factor-auth: \< 1.12 (cvelist)

## Mitigation

- Upgrade django-two-factor-auth to 1.12 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2020-15105. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2020-15105.md
Affected: django-two-factor-auth < 1.12
Fixed in: 1.12

Steps:
1. Search this machine and project for django-two-factor-auth (PyPI), Bouke django-two-factor-auth: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2020-15105 being exploited?

There is no confirmed exploitation: CVE-2020-15105 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.70% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2020-15105?

Medium: CVSS 5.4 (v3.1, scored by CNA). Remote, login needed. A user has to take an action, such as opening a link, for the attack to work. The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2020-15105?

django-two-factor-auth \< 1.12.

### Is there a fix for CVE-2020-15105?

Yes. Fixed in 1.12. Upgrade django-two-factor-auth to 1.12 or later.

### How do I check if I'm affected by CVE-2020-15105?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/Bouke/django-two-factor-auth/security/advisories/GHSA-vhr6-pvjm-9qwf>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2020-15105>
- patch: <https://github.com/Bouke/django-two-factor-auth/commit/454fd9842fa6e8bb772dbf0943976bc8e3335359>
- other: <https://github.com/Bouke/django-two-factor-auth/blob/master/CHANGELOG.md#112---2020-07-08>
- other: <https://github.com/Bouke/django-two-factor-auth>
- other: <https://github.com/pypa/advisory-database/tree/main/vulns/django-two-factor-auth/PYSEC-2020-39.yaml>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2020-15105>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-vhr6-pvjm-9qwf> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2020-39> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2020-15105> · JSON: <https://flawdb.com/api/v1/entries/CVE-2020-15105>
