# CVE-2021-21416: Potential sensitive information disclosed in error reports

> Attackers can view sensitive user credentials in error reports if detailed error logging is enabled during registration failures.

- **Severity:** Low 3.7 (`CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:C/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 1 Apr 2021
- **Updated:** 3 Aug 2024
- **Also known as:** DEBIAN-CVE-2021-21416, GHSA-58c7-px5v-82hh, MGASA-2022-0178, PYSEC-2021-11, UBUNTU-CVE-2021-21416, openSUSE-SU-2021:0588-1, openSUSE-SU-2021:0597-1, openSUSE-SU-2024:11226-1, openSUSE-SU-2024:14138-1, openSUSE-SU-2026:12007-1

## What is CVE-2021-21416?

CVE-2021-21416 is a low-severity vulnerability in ubernostrum django-registration, published on 1 Apr 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

django-registration is a user registration package for Django. The django-registration package provides tools for implementing user-account registration flows in the Django web framework. In django-registration prior to 3.1.2, the base user-account registration view did not properly apply filters to sensitive data, with the result that sensitive data could be included in error reports rather than removed automatically by Django. Triggering this requires: A site is using django-registration < 3.1.2, The site has detailed error reports (such as Django's emailed error reports to site staff/developers) enabled and a server-side error (HTTP 5xx) occurs during an attempt by a user to register an account. Under these conditions, recipients of the detailed error report will see all submitted data from the account-registration attempt, which may include the user's proposed credentials (such as a password).

Weakness: CWE-209 (Generation of Error Message Containing Sensitive Information)

## Which versions are affected by CVE-2021-21416?

3 open source packages ship an affected version, including django-registration. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `django-registration` | PyPI | All versions | 3.1.2 |
| `django-registration` | PyPI | All versions | 3.1.2 |
| `django-registration` | PyPI | All versions | 3.1.2 |
| `python-django-registration` | SUSE:Package Hub 15 SP2 | All versions | 3.1.2-bp152.3.3.1 |
| `python-django-registration` | openSUSE:Leap 15.2 | All versions | 3.1.2-lp152.3.3.1 |
| `python-django-registration` | openSUSE:Tumbleweed | All versions | 3.3-2.2 |
| `python-django-registration` | openSUSE:Tumbleweed | All versions | 5.2.1-1.3 |

Products: Django-Registration Project Django-Registration.

## How do I fix CVE-2021-21416?

Upgrade django-registration to 3.1.2 or later.

## Is CVE-2021-21416 being exploited?

There is no known exploitation of CVE-2021-21416 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-21416 and fix it if it is affected.

What it is: CVE-2021-21416 is a low-severity vulnerability in ubernostrum django-registration, published on 1 Apr 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2021-21416 in the wild and no public exploit code.

Affected packages and fixed versions:
- django-registration (PyPI): affected all versions; fixed in 3.1.2
- django-registration (PyPI): affected all versions; fixed in 3.1.2
- django-registration (PyPI): affected all versions; fixed in 3.1.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-21416/ (Markdown: https://insights.sbomify.com/CVE-2021-21416/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-21416
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-21416
- OSV: https://osv.dev/vulnerability/CVE-2021-21416

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-21416/
Summaries are generated and may contain mistakes; the official description above is the record.
