Skip to content

security(deps): aiohttp 3.14.1 CVE floor across lazy messaging paths + pin-drift guard (salvage #42334) - #56237

Merged
teknium1 merged 5 commits into
mainfrom
hermes/hermes-2f15551b
Jul 1, 2026
Merged

security(deps): aiohttp 3.14.1 CVE floor across lazy messaging paths + pin-drift guard (salvage #42334)#56237
teknium1 merged 5 commits into
mainfrom
hermes/hermes-2f15551b

Conversation

@teknium1

@teknium1 teknium1 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes an active aiohttp vulnerability on the lazy messaging install paths and adds a chokepoint so this pin-drift class can't recur.

Salvage of #42334 (@huangsen365, first-time contributor). His four commits are preserved with authorship; one follow-up commit bumps the pin to the current patched point release (3.14.1) and re-locks.

Changes

  • aiohttp 3.13.43.14.1 across all 6 pyproject extras (messaging, slack, matrix, homeassistant, sms, teams) and the LAZY_DEPS messaging features. 3.14.0 fixed the CVEs; 3.14.1 is the current patched release on that line.
  • Closes the lazy Discord/Matrix gap: platform.discord and platform.matrix pull aiohttp transitively (via discord.py / mautrix+aiohttp-socks) but carried no explicit pin, so the lazy path could keep an already-installed vulnerable aiohttp satisfying the loose <4 / >=3.10 range. Now pinned to the patched floor directly.
  • 3 new packaging guards in tests/test_packaging_metadata.py: pyproject-internal pin consistency, pyproject↔lazy_deps.py agreement, and per-feature security-pin coverage (AST-parsed, exact pins only).
  • cryptography==46.0.7 explicit floor (previously transitive-only via PyJWT[crypto]); anthropic==0.87.0 (already current on main — kept for the contributor's commit intact).
  • scripts/release.py AUTHOR_MAP entry for the attribution check; uv.lock re-synced.

Root cause

3.13.4 is vulnerable to CVE-2026-34993 (CookieJar.load() deserialization → RCE) and CVE-2026-47265 (per-request cookies leaked after a cross-origin redirect — relevant to the OAuth-token-handling gateway). Both fixed only in 3.14.0; no 3.13.x backport. Both confirmed in NVD/GHSA.

Validation

Before (main) After
aiohttp on messaging paths 3.13.4 (vulnerable) 3.14.1 (patched)
lazy platform.discord/matrix aiohttp pin none (transitive, loose range) pinned to patched floor
pin-drift guard tests absent 3 tests, flip-tested (injecting drift fails all 3)
uv lock --check clean (Resolved 233 packages)
tests/test_packaging_metadata.py 11/11 passed

Infographic

PR #42334 infographic

huangsen365 and others added 5 commits July 1, 2026 02:28
…tography floor

- aiohttp 3.13.4 -> 3.14.0 (messaging/slack/homeassistant/sms extras +
  lazy_deps platform.slack) — picks up CVE-2026-34993 (RCE via
  CookieJar.load deserialization) and CVE-2026-47265 (per-request cookie
  leak on cross-origin redirect). Both are fixed only in 3.14.0; there is
  no 3.13.x backport.
- anthropic 0.86.0 -> 0.87.0 (anthropic extra) — CVE-2026-34450 /
  CVE-2026-34452. lazy_deps provider.anthropic was already 0.87.0; the
  extra pin had drifted back to the vulnerable 0.86.0, so this realigns it.
- cryptography pinned explicitly at 46.0.7 in core deps — CVE-2026-39892,
  CVE-2026-34073. It only arrives transitively via PyJWT[crypto]; the
  explicit floor keeps the WeCom/Weixin crypto paths from drifting below
  the fix.

uv.lock regenerated; only aiohttp / anthropic moved (cryptography already
resolved to 46.0.7). Verified 3.14.0 satisfies discord.py 2.7.1
(aiohttp>=3.7.4,<4) and slack-sdk 3.40.1 (aiohttp>=3.7.3,<4).
Adds two checks to tests/test_packaging_metadata.py:

1. No package is exact-pinned to two different versions across
   pyproject.toml's [project.dependencies] / extras.
2. Every package pinned in BOTH the pyproject extras and the LAZY_DEPS
   allowlist in tools/lazy_deps.py uses the same version.

This is the regression guard for the drift the rest of this PR fixes: the
two pin sources are hand-maintained mirrors (lazy_deps even documents
"update both this map AND the corresponding extra"), and they have silently
diverged on aiohttp and anthropic. Run against the pre-fix tree, check (2)
fails on `anthropic: pyproject=['0.86.0'] lazy_deps=['0.87.0']`.

The lazy_deps side is parsed via AST (not imported) so the test stays free
of tools/lazy_deps.py runtime imports; only exact `==` pins are compared.
scripts/release.py AUTHOR_MAP is greped by the Contributor Attribution
Check to resolve a commit author's email -> GitHub username. Add
huangsen365@gmail.com -> huangsen365 so this PR's commits pass the check.

(This commit originally also carried a gateway race-test flake fix; that
edit is now dropped because main independently hardened the same test with
a superior server._sessions snapshot/restore isolation, making ours
redundant.)
… + coverage guard

The messaging extra and platform.slack pin aiohttp==3.14.0, but several
lazy messaging features listed only their SDK and let aiohttp come in
transitively. Each of those SDKs caps aiohttp loosely enough that a
vulnerable already-installed aiohttp still satisfies the range, so the
eager extras got the patched floor while the lazy paths did not:

  - discord.py (aiohttp>=3.7.4,<4)
  - mautrix / aiohttp-socks (aiohttp>=3,<4 / aiohttp>=3.10.0)  [Matrix]
  - microsoft-teams-apps (aiohttp<4)                            [Teams]

(Teams additionally shipped an explicit but *stale* aiohttp==3.13.4 in
both the pyproject `teams` extra and platform.teams.)

- tools/lazy_deps.py: add aiohttp==3.14.0 to platform.discord, platform.matrix;
  bump the stale platform.teams pin 3.13.4 -> 3.14.0.
- pyproject.toml: add aiohttp==3.14.0 to the matrix extra; bump the teams extra
  3.13.4 -> 3.14.0 (homeassistant/sms/messaging already at 3.14.0).
- tests/test_packaging_metadata.py: test_security_pins_present_in_mirrored_lazy_features
  now covers platform.discord/slack/matrix/teams. The existing agree-guard only
  compares packages pinned in BOTH sources, so it can't catch a lazy feature
  that omits a pin entirely; this guard is an explicit coverage contract
  (security package -> lazy features that must carry it) and fails with
  'platform.matrix: aiohttp=MISSING' if a floor is dropped again.
- uv.lock: regenerated, zero drift (aiohttp 3.14.0).
3.14.1 is the current patched release on the 3.14 line; both CVE-2026-34993
(CookieJar.load RCE) and CVE-2026-47265 (per-request cookie leak on
cross-origin redirect) are fixed as of 3.14.0, and 3.14.1 rolls up the
subsequent point fixes. Re-locked uv.lock.
@teknium1
teknium1 requested a review from a team July 1, 2026 09:31
@alt-glitch alt-glitch added type/security Security vulnerability or hardening comp/tools Tool registry, model_tools, toolsets area/config Config system, migrations, profiles dependencies Pull requests that update a dependency file P2 Medium — degraded but workaround exists labels Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/tools Tool registry, model_tools, toolsets dependencies Pull requests that update a dependency file P2 Medium — degraded but workaround exists type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants