# CVE-2021-41945: Improper Input Validation in httpx

- Severity: Critical 9.1 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 2.12%, higher than 82% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 3 links below, marked "exploit"
- Published: 2022-04-28T13:22:10.000Z
- Modified: 2026-07-09T01:17:04.390Z
- Also known as: GHSA-h8pj-cxx2-jfg2, PYSEC-2022-183
- Weaknesses: CWE-20
- Assigned by: mitre

## Description

Encode OSS httpx < 0.23.0 is affected by improper input validation in `httpx.URL`, `httpx.Client` and some functions using `httpx.URL.copy_with`.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- httpx (PyPI): before 0.23.0; before 0.20.0
- encode httpx: before 0.23.0

## Every score

- GitHub: CVSS:3.1 9.1 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`
- GitHub: CVSS:4.0 Critical `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 9.1 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`
- NVD: CVSS:2.0 6.4 Medium `AV:N/AC:L/Au:N/C:P/I:P/A:N`

## References

- <https://gist.github.com/lebr0nli/4edb76bbd3b5ff993cf44f2fbce5e571> (exploit, third-party-advisory, web)
- <https://github.com/encode/httpx/discussions/1831> (exploit, issue-tracking, third-party-advisory, web)
- <https://github.com/encode/httpx/issues/2184> (exploit, issue-tracking, report, third-party-advisory, web)
- <https://github.com/encode/httpx> (package, product, third-party-advisory, web)
- <https://github.com/encode/httpx/releases/tag/0.23.0> (release-notes, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-41945> (advisory)
- <https://github.com/encode/httpx/pull/2185> (web)
- <https://github.com/encode/httpx/pull/2185/commits/e3c495a32c63d8aa7f1bcf3b7b27ee1a0ff428e1> (web)
- <https://github.com/encode/httpx/commit/e9b0c85dd4f4e4469c57c4b38e5101fd12081b5c> (web)
- <https://github.com/advisories/GHSA-h8pj-cxx2-jfg2> (advisory)
- <https://github.com/pypa/advisory-database/tree/main/vulns/httpx/PYSEC-2022-183.yaml> (web)
- <http://encode.com> (web)

## Sources

- CVE List: [CVE-2021-41945](https://www.cve.org/CVERecord?id=CVE-2021-41945), CVE Terms of Use, modified 2026-07-09
- GitHub Advisory Database: [GHSA-h8pj-cxx2-jfg2](https://github.com/advisories/GHSA-h8pj-cxx2-jfg2), CC-BY-4.0, modified 2025-02-13
- NVD: [CVE-2021-41945](https://nvd.nist.gov/vuln/detail/CVE-2021-41945), Public domain, modified 2026-07-09
- PyPA Advisory Database: [PYSEC-2022-183](https://osv.dev/vulnerability/PYSEC-2022-183), CC-BY-4.0, modified 2023-11-08

---

Page: https://cve.day/CVE-2021-41945 · Whole record: https://cve.day/CVE-2021-41945.json · Rebuilt by cve.day 2026-11-25T22:58:07.427Z
