Skip to content

fix(deps): Bump anyio to 4.14.2 for GHSA-82r6-8w77-94w6 - #125184

Merged
oioki merged 1 commit into
masterfrom
fix/bump-anyio-4-14-2
Sep 22, 2026
Merged

oioki merged 1 commit into
masterfrom
fix/bump-anyio-4-14-2

Conversation

@oioki

@oioki oioki commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Bump anyio 3.7.1 → 4.14.2 in uv.lock, closing Dependabot alerts #721 and #720.

  • GHSA-82r6-8w77-94w6 / CVE-2026-63374 (critical) — TLSStream.wrap() and connect_tcp() encode internationalized host names with IDNA 2003. An attacker who can redirect a connection to a non-ASCII domain can obtain a legitimate certificate for the IDNA 2003 encoding of that name and have it validate on the client.
  • GHSA-5p39-cfhj-2xmp / CVE-2026-64847 (medium) — process-pool workers can block indefinitely on undrained stderr.

This bump was blocked until now: openai==1.3.5 pinned anyio<4, so the resolver could not move it. That dependency turned out to be unused and was removed in #125177, which this PR builds on. sniffio is no longer an anyio dependency but stays in the lock via another dependent.

On the major version bump (3.x → 4.x)

anyio 4.0.0 has six backwards-incompatible changes; 4.1 through 4.14.2 add none. Only one is reachable from this repo:

  • Task-group exceptions are now wrapped in ExceptionGroup and related cancellation-semantics changes. No consumer here catches ExceptionGroup or relies on unwrapped task-group exceptions.
  • The pytest plugin now runs tests and fixtures in the same task. This is the only change that touches our own code — tests/apigw/test_circuitbreaker.py uses @pytest.mark.anyio. All 13 tests in tests/apigw/ pass.
  • anyio.Path.relative_to()/is_relative_to(), old-style coroutine tasks, and the asyncio policy option: no usage anywhere.

Consumers of anyio in the resolved environment, and why each is safe:

Package Pulled in by How it uses anyio
watchfiles granian Only declared dependent. granian calls the sync watchfiles.watch() (Rust + threads); the anyio-based awatch/arun_process paths are never executed. Reload is dev-only (SENTRY_GRANIAN_RELOAD).
httpcore sentry-sdk[http2] Optional AnyIOBackend, async pool only. sentry is WSGI, and sdk_http2_experiment.enabled defaults to False.
granian direct try: import anyio / except: anyio = None; no API use.
huggingface_hub tokenizers An open_process monkeypatch in the MCP CLI, never reached.

Verified: every anyio attribute these packages reference resolves under 4.14.2; all four import cleanly; httpcore's AnyIOBackend completes a real TLS request over anyio 4 (status 200); watchfiles.watch() detects changes; tests/apigw/ passes.

Worth noting the bump also resolves a latent mismatch: httpcore 1.0.9 declares anyio>=4.0,<5.0 for its asyncio extra, so at 3.7.1 we were below the floor httpcore supports.

Done by hand because Dependabot's auto-fix could not regenerate uv.lock for this repo — it ran uv under Python 3.14 and failed on backports-zstd having no cp314 wheels. #125179 fixed that root cause by declaring requires-python.

Fixes GHSA-82r6-8w77-94w6

anyio < 4.14.2 has two advisories:

- GHSA-82r6-8w77-94w6 (critical): TLSStream / connect_tcp() encode
  internationalized host names with IDNA 2003, so a hijacked connection
  to a non-ASCII domain can present a certificate for the IDNA 2003
  form of the name and pass validation.
- GHSA-5p39-cfhj-2xmp (medium): process-pool workers can block
  indefinitely on undrained stderr.

anyio is only a transitive dependency of watchfiles here; sentry does
not call it directly. The upgrade was blocked by openai==1.3.5 pinning
anyio<4 until that dependency was removed in #125177. sniffio stays in
the lock via other dependents.

Co-Authored-By: Claude <[email protected]>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 22, 2026
@oioki
oioki marked this pull request as ready for review September 22, 2026 11:27
@oioki
oioki merged commit 87dbdd1 into master Sep 22, 2026
90 checks passed
@oioki
oioki deleted the fix/bump-anyio-4-14-2 branch September 22, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants