Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-32052

In Django 2.2 before 2.2.22, 3.1 before 3.1.10, and 3.2 before 3.2.2 (with Python 3.9.5+), URLValidator does not prohibit newlines and tabs (unless the URLField form field is used). If an application uses values with newlines in an HTTP response, header injection can occur. Django itself is unaffected because HttpResponse prohibits newlines in HTTP headers.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-32052
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 05:45 UTC · Revision 1

Source evidence

CVE-2021-32052

core-osv · Original source

Published 6 May 2021, 16:15 UTC

In Django 2.2 before 2.2.22, 3.1 before 3.1.10, and 3.2 before 3.2.2 (with Python 3.9.5+), URLValidator does not prohibit newlines and tabs (unless the URLField form field is used). If an application uses values with newlines in an HTTP response, header injection can occur. Django itself is unaffected because HttpResponse prohibits newlines in HTTP headers.

osv:CVE-2021-32052
Complete source record
{
  "id": "042aff332afbe3760805b7169cc6e1a6d28b096123b6f40f77f85dd9b58a5b1e",
  "url": "https://osv.dev/vulnerability/CVE-2021-32052",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-32052",
    "summary": "In Django 2.2 before 2.2.22, 3.1 before 3.1.10, and 3.2 before 3.2.2 (with Python 3.9.5+), URLValidator does not prohibit newlines and tabs (unless the URLField form field is used). If an application uses values with newlines in an HTTP response, header injection can occur. Django itself is unaffected because HttpResponse prohibits newlines in HTTP headers.",
    "evidence": "osv:CVE-2021-32052",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2021-32052",
      "aliases": [
        "BIT-django-2021-32052",
        "CVE-2021-32052",
        "GHSA-qm57-vhq3-3fwf",
        "PYSEC-2021-8"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/django/django",
              "type": "GIT",
              "events": [
                {
                  "introduced": "2a62cdcfec85938f40abb2e9e6a9ff497e02afe8"
                },
                {
                  "fixed": "df9fd4661e203d41c189054d8b23d256815e14fc"
                },
                {
                  "introduced": "0b8a0296bfd30748f08021834e95cdae241686e8"
                },
                {
                  "fixed": "a2407cd67bd98cc2de4ed7784eb6beee67b3898f"
                },
                {
                  "introduced": "3591e1c1acbd7c13174275367c3fdf012cb0413b"
                },
                {
                  "fixed": "26e033b1b7dd54aa8b55bc49d49d611bf6d09f85"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.2"
                      },
                      {
                        "fixed": "2.2.22"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "3.1"
                      },
                      {
                        "fixed": "3.1.10"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "3.2"
                      },
                      {
                        "fixed": "3.2.2"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-32052.json"
          }
        }
      ],
      "modified": "2026-10-24T10:30:33.033959972Z",
      "provider": "osv",
      "references": [
        "https://groups.google.com/forum/#%21forum/django-announce",
        "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZVKYPHR3TKR2ESWXBPOJEKRO2OSJRZUE/",
        "https://security.netapp.com/advisory/ntap-20210611-0002/",
        "https://docs.djangoproject.com/en/3.2/releases/security/",
        "https://www.djangoproject.com/weblog/2021/may/06/security-releases/"
      ],
      "provider_metadata": {
        "unresolved_ranges": [
          {
            "cpes": [
              "cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*"
            ],
            "vendor_product": "fedoraproject:fedora",
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "34"
                  },
                  {
                    "last_affected": "34"
                  }
                ],
                "source": "CPE_STRING"
              }
            ]
          }
        ]
      }
    },
    "related_cves": [
      {
        "value": "CVE-2021-32052",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 433163,
  "published_at": "2021-05-06T16:15:07.52+00:00"
}