Skip to content

chore: floor urllib3 in the [eth] extra - #593

Open
Zyrtnin wants to merge 1 commit into
mainfrom
chore/urllib3-floor-on-eth-extra
Open

chore: floor urllib3 in the [eth] extra#593
Zyrtnin wants to merge 1 commit into
mainfrom
chore/urllib3-floor-on-eth-extra

Conversation

@Zyrtnin

@Zyrtnin Zyrtnin commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

pyrxd does not import urllib3. It arrives two levels down — web3requestsurllib3<3,>=1.26 — so pip install pyrxd[eth] pulls it whether we mention it or not.

Versions below 2.7.0 carry two advisories:

PYSEC-2026-141 a proxied cross-origin redirect forwards sensitive headers
PYSEC-2026-142 decompression bomb via Brotli streaming or drain_conn

Hygiene, not a fix — and the comment in pyproject.toml says so

Neither is reachable through pyrxd's usage, measured on 2026-09-03:

  • brotli is not installed
  • drain_conn appears in 0 files across web3/requests
  • web3 uses stream=True at 0 sites

The header leak's vulnerable call does exist — requests/adapters.py:651 passes assert_same_host=False through a ProxyManager — but reaching it needs a configured proxy and a hostile redirect from the RPC endpoint. No exploit was demonstrated, so by this repo's review rule that is a path, not a finding.

The floor exists so a consumer's own pip-audit is not handed a finding by our extra.

The cost, stated

Owning a constraint on a package we do not import can conflict with a consumer's tree. It is the only such floor, and the comment says to remove it once requests floors urllib3 itself. Compatible with requests' own range — 2.7.x satisfies both <3,>=1.26 and >=2.7.0.

A near-miss in the triage

The first dependency-closure walk parsed urllib3>=1.21.1,<3 with .split()[0], kept the version specifier as part of the package name, matched nothing, and concluded urllib3 was unreachable from the consumer closure. It is not. Redone with packaging.requirements.Requirement.

CI-equivalent locally: 10,993 passed, 192 skipped, 1 xfailed.

🤖 Generated with Claude Code

pyrxd does not import urllib3. It arrives two levels down — web3 requires
requests>=2.23.0, which requires urllib3<3,>=1.26 — so `pip install pyrxd[eth]`
pulls it whether we mention it or not.

urllib3 below 2.7.0 carries two advisories: PYSEC-2026-141, where a proxied
cross-origin redirect forwards sensitive headers, and PYSEC-2026-142, a
decompression bomb via Brotli streaming or drain_conn.

HYGIENE, NOT A FIX, and the comment in pyproject.toml says so. Measured on
2026-09-03: brotli is not installed, `drain_conn` appears in 0 files across
web3/requests, and web3 uses `stream=True` at 0 sites — so the decompression
issue is unreachable. The header leak's vulnerable call DOES exist
(requests/adapters.py:651 passes assert_same_host=False through a ProxyManager),
but reaching it needs a configured proxy AND a hostile redirect from the RPC
endpoint, and no exploit was demonstrated. By this repo's review rule that makes
it a path, not a finding.

The floor is here so a consumer's own pip-audit is not handed a finding by our
extra. Owning a constraint on a package we do not import has a real cost — it can
conflict with a consumer's tree — so it is the only such floor, and the comment
says to remove it once requests floors urllib3 itself.

Compatible with requests' own range: 2.7.x satisfies both <3,>=1.26 and >=2.7.0.

Found by pip-audit during the security review. Worth noting the triage nearly went
wrong: the first dependency-closure walk parsed "urllib3>=1.21.1,<3" with
`.split()[0]`, kept the version specifier as part of the name, matched nothing,
and concluded the package was unreachable. The chain is real.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant