CVE-2021-21416
JSON

3.7low

Potential sensitive information disclosed in error reports

Severity
3.7low CVSS:3.1 by GitHub_M
Exploit likelihood
0.41% (higher than 37% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-58c7-px5v-82hhPYSEC-2021-11

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

Affected

Product or packageVersionsReported by
ubernostrum django-registration< 3.1.2CVE List
django-registration (PyPI)before 3.1.2GitHub Advisory Database, PyPA Advisory Database
django-registration_project django-registrationbefore 3.1.2NVD

All scores

GitHub_M3.7low CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:C/C:L/I:L/A:N
GitHub3.7low CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:C/C:L/I:L/A:N
GitHublow CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
NVD2.6low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:L/I:N/A:N
NVD3.5low CVSS:2.0AV:N/AC:M/Au:S/C:P/I:N/A:N

Classification

What each source says

CVE List

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

GitHub Advisory Database

django-registration is a user-registration application for Django.

Impact

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 the following conditions:

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

Patches

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

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

Workarounds

Users 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:

from django.utils.decorators import method_decorator
from django.views.decorators.debug import sensitive_post_parameters

from django_registration.views import RegistrationView

class MyRegistrationView(RegistrationView):
    """
    A RegistrationView subclass manually protected against sensitive information disclosure
    in error reports.

    """
    @method_decorator(sensitive_post_parameters())
    def dispatch(self, *args, **kwargs):
        return super().dispatch(*args, **kwargs)
References
NVD (es)

django-registration es un paquete de registro de usuarios para Django.&#xa0;El paquete django-registration proporciona herramientas para implementar flujos de registro de cuentas de usuario en el framework web de Django.&#xa0;En django-registration anterior a versión 3.1.2, la vista de registro de la cuenta de usuario base no aplicaba filtros correctamente a los datos confidenciales, con el resultado de que los datos confidenciales podrían incluirse en los reportes de errores en lugar de ser eliminados automáticamente por Django.&#xa0;Activar esto requiere: Un sitio está usando django-registration versiones anteriores a 3.1.2, El sitio tiene reportes de error detallados (como los reportes de error enviados por correo electrónico de Django al personal y desarrolladores del sitio) habilitados y se produce un error del lado del servidor (HTTP 5xx) durante un intento de por parte de un usuario de un registro de cuenta.&#xa0;Bajo estas condiciones, los destinatarios del reporte de error detallado verán todos los datos enviados desde el intento de registro de la cuenta, que pueden incluir las credenciales propuestas del usuario (tales como una contraseña)

References

Sources

SourceRecordLicence
CVE ListCVE-2021-21416 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-58c7-px5v-82hh changed 2026-07-08CC-BY-4.0
NVDCVE-2021-21416 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2021-11 changed 2023-11-08CC-BY-4.0