{"id":"CVE-2021-21416","aliases":["GHSA-58c7-px5v-82hh","PYSEC-2021-11"],"title":"Potential sensitive information disclosed in error reports","summary":"Potential sensitive information disclosed in error reports","severity":"low","cvss":3.7,"cvssVector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:C/C:L/I:L/A:N","vendor":"django-registration","product":"django-registration","ecosystem":"pip","affected":["django-registration < 3.1.2"],"patched":["django-registration 3.1.2"],"published":"2021-04-06","updated":"2026-07-08","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/GHSA-58c7-px5v-82hh","references":[{"url":"https://github.com/ubernostrum/django-registration/security/advisories/GHSA-58c7-px5v-82hh"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21416"},{"url":"https://github.com/ubernostrum/django-registration/commit/2db0bb7ec35636ea46b07b146328b87b2cb13ca5"},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/django-registration/PYSEC-2021-11.yaml"},{"url":"https://github.com/ubernostrum/django-registration"}],"tags":["osv","pip"],"epss":0.0041,"epssPercentile":0.32442,"ingestedAt":"2026-07-08T18:25:45.816Z","slug":"CVE-2021-21416","body":"## Overview\n\ndjango-registration is a user-registration application for Django. \n\n### Impact\n\nThe 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.\n\nTriggering this requires the following conditions:\n\n* A site is using django-registration < 3.1.2\n* The site has detailed error reports (such as Django's [emailed error reports to site staff/developers](https://docs.djangoproject.com/en/3.1/howto/error-reporting/#email-reports)) enabled\n* A server-side error (HTTP 5xx) occurs during an attempt by a user to register an account\n\nUnder 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).\n\n### Patches\n\nAs of version 3.1.2, django-registration properly applies Django's `sensitive_post_parameters()` decorator to the base user-registration view, which will cause all data from the HTTP request body to be filtered from detailed error reports in the event of a server-side crash during user account registration.\n\nNote that as applied, this filters *all* HTTP request data from error reports. To selectively allow some fields but not others, see Django's own documentation (in references) and the notes below for how to apply `sensitive_post_parameters()` manually to a particular codebase's `RegistrationView` subclass(es).\n\n### Workarounds\n\nUsers who cannot upgrade quickly can apply the `django.views.decorators.debug.sensitive_post_parameters()` decorator to their own registration views. The decorator should be applied on the `dispatch()` method of the appropriate `RegistrationView` class, using Django's `method_decorator()` helper. For example:\n\n```python\nfrom django.utils.decorators import method_decorator\nfrom django.views.decorators.debug import sensitive_post_parameters\n\nfrom django_registration.views import RegistrationView\n\nclass MyRegistrationView(RegistrationView):\n    \"\"\"\n    A RegistrationView subclass manually protected against sensitive information disclosure\n    in error reports.\n\n    \"\"\"\n    @method_decorator(sensitive_post_parameters())\n    def dispatch(self, *args, **kwargs):\n        return super().dispatch(*args, **kwargs)\n```\n\n### References\n\n* Django's documentation on [error reporting in production](https://docs.djangoproject.com/en/3.1/howto/error-reporting/)\n* [How Django's sensitive-data filters work](https://docs.djangoproject.com/en/3.1/howto/error-reporting/#filtering-error-reports)\n\n## Affected packages\n\n- `django-registration < 3.1.2`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `django-registration 3.1.2`","depth":"sunlit","depthScore":20,"depthScoreParts":{"impact":20.4,"likelihood":0.1,"exploitation":0,"ransomware":0},"changes":[]}