Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2022-0391

A flaw was found in Python, specifically within the urllib.parse module. This module helps break Uniform Resource Locator (URL) strings into components. The issue involves how the urlparse method does not sanitize input and allows characters like '\r' and '\n' in the URL path. This flaw allows an attacker to input a crafted URL, leading to injection attacks. This flaw affects Python versions prior to 3.10.0b1, 3.9.5, 3.8.11, 3.7.11 and 3.6.14.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-0391
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 03:54 UTC · Revision 1

Source evidence

CVE-2022-0391

core-osv · Original source

Published 9 Feb 2022, 00:00 UTC

A flaw was found in Python, specifically within the urllib.parse module. This module helps break Uniform Resource Locator (URL) strings into components. The issue involves how the urlparse method does not sanitize input and allows characters like '\r' and '\n' in the URL path. This flaw allows an attacker to input a crafted URL, leading to injection attacks. This flaw affects Python versions prior to 3.10.0b1, 3.9.5, 3.8.11, 3.7.11 and 3.6.14.

osv:CVE-2022-0391
Complete source record
{
  "id": "7dd5365cd0159fb3998dce6b56268f788f4d63f5904559cdbd8740c8764cc12a",
  "url": "https://osv.dev/vulnerability/CVE-2022-0391",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2022-0391",
    "summary": "A flaw was found in Python, specifically within the urllib.parse module. This module helps break Uniform Resource Locator (URL) strings into components. The issue involves how the urlparse method does not sanitize input and allows characters like '\\r' and '\\n' in the URL path. This flaw allows an attacker to input a crafted URL, leading to injection attacks. This flaw affects Python versions prior to 3.10.0b1, 3.9.5, 3.8.11, 3.7.11 and 3.6.14.",
    "evidence": "osv:CVE-2022-0391",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2022-0391",
      "aliases": [
        "BIT-libpython-2022-0391",
        "BIT-python-2022-0391",
        "BIT-python-min-2022-0391",
        "CVE-2022-0391",
        "PSF-2022-8"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/python/cpython",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "9a0099d1bf14bce417370aae6d55527417cda354"
                },
                {
                  "introduced": "1bf9cc509326bc42cd8cb1650eb9bf64550d817e"
                },
                {
                  "fixed": "9da28d2b3429d1bb30e082e4c9cb544d81fdae20"
                },
                {
                  "introduced": "fa919fdf2583bdfead1df00e842f24f30b2a34bf"
                },
                {
                  "fixed": "c3ffbbdf3d5645ee07c22649f2028f9dffc762ba"
                },
                {
                  "introduced": "9cf6752276e6fcfd0c23fdb064ad27f448aaaf75"
                },
                {
                  "fixed": "0a7dcbdb13f1f2ab6e76e1cff47e80fb263f5da0"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:python:python:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "3.6.14"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:python:python:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "3.7.0"
                      },
                      {
                        "fixed": "3.7.11"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:python:python:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "3.8.0"
                      },
                      {
                        "fixed": "3.8.11"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:python:python:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "3.9.0"
                      },
                      {
                        "fixed": "3.9.5"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v3.9.2",
            "v3.8.8",
            "v3.9.2rc1",
            "v3.8.8rc1",
            "v3.6.13",
            "v3.7.10",
            "v3.6.12",
            "v3.7.9",
            "v3.9.0b5",
            "v3.8.5",
            "v3.7.8",
            "v3.6.11",
            "v3.6.11rc1",
            "v3.7.8rc1",
            "v3.9.0b3",
            "v3.9.0b1",
            "v3.8.3",
            "v3.8.3rc1",
            "v3.7.7rc1",
            "v3.9.0a2",
            "v3.6.10",
            "v3.6.10rc1",
            "v3.7.6rc1",
            "v3.8.0rc1",
            "v3.6.9",
            "v3.6.9rc1",
            "v3.7.3rc1",
            "v3.6.8",
            "v3.7.2rc1",
            "v3.6.8rc1",
            "v3.7.0rc1",
            "v3.6.6rc1",
            "v3.7.0b5",
            "v3.7.0b4",
            "v3.7.0b3",
            "v3.7.0b2",
            "v3.7.0b1",
            "v3.7.0a2",
            "v3.6.2rc1",
            "v3.6.0rc1",
            "v3.6.0b4",
            "v3.6.0b3",
            "v3.6.0b1",
            "v3.6.0a3",
            "v3.5.0b1",
            "v3.5.0a4",
            "v3.5.0a3",
            "v3.5.0a2",
            "v3.5.0a1",
            "v3.4.0b3",
            "v3.4.0b2",
            "v3.4.0b1",
            "v3.4.0a4",
            "v3.4.0a3",
            "v3.4.0a2",
            "v3.4.0a1",
            "v3.3.0rc3",
            "v3.3.0rc2",
            "v3.3.0rc1",
            "v3.3.0b2",
            "v3.3.0b1",
            "v3.3.0a4",
            "v3.3.0a3",
            "v3.3.0a2",
            "v3.2rc3",
            "v3.2rc2",
            "v3.2rc1",
            "v3.2b2",
            "v3.2b1",
            "v3.2a4",
            "v3.2a3",
            "v3.2a2",
            "v3.2a1",
            "v3.1",
            "v3.1rc2",
            "v3.1rc1",
            "v3.1b1",
            "v3.1a2",
            "v3.1a1",
            "v3.0rc3",
            "v3.0rc2",
            "v3.0rc1",
            "v3.0b3",
            "v3.0b2",
            "v3.0b1",
            "v3.0a5",
            "v3.0a4",
            "v3.0a3",
            "v3.0a2",
            "v3.0a1",
            "v2.4",
            "v2.4c1",
            "v2.4b2",
            "v2.4b1",
            "v2.4a3",
            "v2.4a2",
            "v2.4a1",
            "v2.3c2",
            "v2.3c1",
            "v2.2a3",
            "v2.1",
            "v2.1c2",
            "v2.1c1",
            "v2.1b2",
            "v2.1b1",
            "v2.1a2",
            "v2.1a1",
            "v2.0",
            "v2.0c1",
            "v2.0b2",
            "v2.0b1",
            "v1.6a2",
            "v1.6a1",
            "v1.5.2",
            "v1.5.2c1",
            "v1.5.2b2",
            "v1.5.2b1",
            "v1.5.2a2",
            "v1.5.2a1",
            "v1.5.1",
            "v1.5",
            "v1.5b2",
            "v1.5b1",
            "v1.5a4",
            "v1.5a3",
            "v1.5a2",
            "v1.5a1",
            "v1.4",
            "v1.4b3",
            "v1.4b2",
            "v1.4b1",
            "v1.3",
            "v1.3b1",
            "v1.2",
            "v1.2b4",
            "v1.2b3",
            "v1.2b2",
            "v1.2b1",
            "v1.1.1",
            "v1.1",
            "v1.0.2",
            "v1.0.1",
            "v0.9.9",
            "v0.9.8"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-0391.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:42.085547596Z",
      "provider": "osv",
      "references": [
        "https://bugs.python.org/issue43882",
        "https://cert-portal.siemens.com/productcert/html/ssa-398330.html",
        "https://lists.debian.org/debian-lts-announce/2024/11/msg00024.html",
        "https://lists.debian.org/debian-lts-announce/2025/03/msg00013.html",
        "https://www.oracle.com/security-alerts/cpuapr2022.html",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/0xxx/CVE-2022-0391.json",
        "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CSD2YBXP3ZF44E44QMIIAR5VTO35KTRB/",
        "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UDBDBAU6HUPZHISBOARTXZ5GKHF2VH5U/",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-0391",
        "https://security.gentoo.org/glsa/202305-02",
        "https://security.netapp.com/advisory/ntap-20220225-0009/",
        "https://lists.debian.org/debian-lts-announce/2023/09/msg00022.html"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-74"
        ],
        "cna_assigner": "redhat",
        "unresolved_ranges": [
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "python 3.10.0b1, python 3.9.5, python 3.8.11, python 3.7.11, python 3.6.14"
                  },
                  {
                    "last_affected": "python 3.10.0b1, python 3.9.5, python 3.8.11, python 3.7.11, python 3.6.14"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "StandaloneSingleVersion"
              }
            ]
          }
        ],
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/0xxx/CVE-2022-0391.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-0391",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 510041,
  "published_at": "2022-02-09T00:00:00+00:00"
}