Skip to content

fix(deps): bump urllib3, aiohttp, cryptography to patch disclosed CVEs - #4829

Open
aeonframework wants to merge 4 commits into
openai:mainfrom
aeonframework:security/bump-urllib3-aiohttp-cryptography
Open

fix(deps): bump urllib3, aiohttp, cryptography to patch disclosed CVEs#4829
aeonframework wants to merge 4 commits into
openai:mainfrom
aeonframework:security/bump-urllib3-aiohttp-cryptography

Conversation

@aeonframework

Copy link
Copy Markdown

Automated dependency bump addressing several disclosed CVEs, found via dependency scanning and verified against the OSV database at the target versions before opening this PR.

Changes

  • urllib3 2.5.02.7.0 — transitive dependency of the core requests dependency. Fixes:
    • GHSA-qccp-gfcp-xxvc (CVE-2026-44431, CVSS 8.2) — sensitive headers forwarded across origins in proxied low-level redirects
    • GHSA-2xpw-w6gg-jr37 (CVE-2025-66471, CVSS 8.9) — streaming API mishandles highly compressed data
    • GHSA-38jv-5279-wg99 (CVE-2026-21441, CVSS 8.9) — decompression-bomb safeguard bypass via redirects
    • GHSA-gm62-xv2j-4w53 (CVE-2025-66418, CVSS 8.9) — unbounded links in the decompression chain
  • aiohttp 3.12.153.14.3 (blaxel/cloudflare extras) — within the existing aiohttp>=3.12,<4 range. Clears 30 disclosed advisories (CVE-2025-692xx / CVE-2026-345xx series), all fixed as of this release.
  • cryptography 45.0.746.0.7 (encrypt extra + dev dependency group) — fixes GHSA-p423-j2cm-9vmq (CVE-2026-39892, CVSS 9.8 critical): a buffer overflow when a non-contiguous buffer (e.g. buf[::-1]) is passed to APIs like Hash.update() on Python >3.11. No 45.x release fixes this advisory, so the declared range in pyproject.toml needed widening from >=45.0, <46 to >=46.0.7, <47.

Verified against https://api.osv.dev/v1/query at each target version — zero remaining advisories for urllib3 2.7.0 and aiohttp 3.14.3.

Not fully remediated by this PR: cryptography 46.0.7 still carries 4 residual advisories that require a much larger jump (46.x → 48.0.1 for GHSA-537c-gmf6-5ccf, bundled vulnerable OpenSSL; → a later release for GHSA-g6cj-pr64-35w5 PKCS#7 Bleichenbacher oracle, GHSA-jwv3-5hgf-82ww duplicate-self-signed-intermediate path-building DoS, and GHSA-m2h6-j472-rp4c wildcard-DNS permittedSubtrees escape — all clear only at 50.0.1, the current latest). Spanning three more majors (47→50) is a larger compatibility surface than seemed appropriate to bundle here; happy to open that as a follow-up if useful. This PR's 46.0.7 landing was chosen specifically because it closes the one critical (9.8) advisory.

litellm (litellm extra) also has open advisories (e.g. GHSA-4xpc-pv4p-pm3w/CVE-2026-49468, CVSS 9.8) fixed in 1.99.0, but this project's pyproject.toml sets [tool.uv] exclude-newer = "7 days" as a deliberate supply-chain freshness policy, and 1.99.0 was published within that window as of this PR — uv lock --upgrade-package litellm correctly refuses to select it. Not bundled here since overriding that policy isn't this PR's call to make; it should resolve on its own once the fix ages past 7 days, or can be pulled forward explicitly via exclude-newer-package = { litellm = false } if wanted sooner.

Detected by osv-scanner, cross-checked against the OSV API. No code changes outside pyproject.toml/uv.lock.


Filed by Aeon.

- urllib3 2.5.0 -> 2.7.0: fixes GHSA-qccp-gfcp-xxvc (CVE-2026-44431, proxied-redirect
  header leak), GHSA-2xpw-w6gg-jr37 (CVE-2025-66471, streaming decompression-bomb),
  GHSA-38jv-5279-wg99 (CVE-2026-21441, decompression-bomb bypass via redirects),
  GHSA-gm62-xv2j-4w53 (CVE-2025-66418, unbounded decompression chain). Transitive
  dependency of the core requests dependency; no manifest change needed.
- aiohttp 3.12.15 -> 3.14.3 (blaxel/cloudflare extras): clears 30 disclosed
  advisories, all fixed by the current release; within the existing
  aiohttp>=3.12,<4 declared range.
- cryptography 45.0.7 -> 46.0.7 (encrypt extra + dev group): fixes
  GHSA-p423-j2cm-9vmq (CVE-2026-39892, CVSS 9.8 critical buffer overflow on
  non-contiguous buffer input to Hash.update()/similar). No 45.x release fixes
  this; required widening the declared range from <46 to <47.

Not bundled: 4 residual cryptography advisories (GHSA-537c-gmf6-5ccf bundled
vulnerable OpenSSL, GHSA-g6cj-pr64-35w5 PKCS#7 Bleichenbacher oracle,
GHSA-jwv3-5hgf-82ww path-building DoS, GHSA-m2h6-j472-rp4c wildcard-DNS
permittedSubtrees escape) need 48.0.1+/50.0.1, a much larger jump across
several majors -- left as a follow-up rather than risk in this PR. litellm's
open advisories have no fix available within this repo's own uv
exclude-newer=7-days supply-chain freshness policy as of today; will resolve
on its own once the fixed litellm release ages past that window.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 74d8a7efb5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread uv.lock
[[package]]
name = "aiohttp"
version = "3.12.15"
version = "3.14.3"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Raise the aiohttp floor in published extras

When a user upgrades openai-agents[cloudflare] or openai-agents[blaxel] in an environment that already contains a vulnerable aiohttp 3.12.x release, the unchanged aiohttp>=3.12,<4 requirements in pyproject.toml remain satisfied. This lockfile-only bump therefore protects repository development installs but not SDK consumers, even though these extras directly execute aiohttp networking code; raise both published extra constraints to the first remediated version (>=3.14.3).

AGENTS.md reference: AGENTS.md:L145-L148

Useful? React with 👍 / 👎.

@sylvesterkaczmarek sylvesterkaczmarek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s the same consumer-side gap for urllib3. This only moves urllib3 to 2.7.0 in uv.lock; the published core requirement is still just requests>=2,<3, which can leave an already-installed vulnerable urllib3 2.5.0 in place. If this PR is meant to remediate the listed urllib3 CVEs for SDK users, the published dependency graph needs a safe urllib3 floor too, not only the dev lock.

The urllib3 CVEs this PR remediates are pulled in transitively via the
core `requests` dependency, so bumping only uv.lock left the published
dependency graph without a safe floor: an SDK consumer with urllib3
2.5.0 already installed would keep a vulnerable version.

Add an explicit `urllib3>=2.7.0, <3` core dependency so a fresh install
or upgrade cannot resolve below the highest disclosed fix
(GHSA-qccp-gfcp-xxvc). Addresses review feedback from @sylvesterkaczmarek.
@aeonframework

Copy link
Copy Markdown
Author

Thanks @sylvesterkaczmarek, you are right - the urllib3 CVEs come in transitively through requests, so the lock bump alone left the published graph without a floor. Pushed 1334e93 adding an explicit urllib3>=2.7.0, <3 core dependency (2.7.0 is the highest disclosed fix, GHSA-qccp-gfcp-xxvc), so a fresh install or upgrade can no longer resolve below it. uv lock re-resolved with no other version changes.

@seratch seratch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The published blaxel and cloudflare extras still allow aiohttp>=3.12,<4, so an SDK upgrade can retain an older installed aiohttp even though uv.lock selects 3.14.3. Please align the published requirements with the intended remediated floor, then validate the affected extras with the actual upgraded dependencies. The existing probe environment used the old versions and cannot establish that compatibility.

@seratch seratch changed the title fix(deps): bump urllib3, aiohttp, cryptography to patch disclosed CVEs (incl. 1 critical) fix(deps): bump urllib3, aiohttp, cryptography to patch disclosed CVEs Sep 5, 2026
…+ fix pyright WS generic

Addresses @seratch's review on openai#4829.

- Raise the published aiohttp requirement in the `blaxel` and `cloudflare`
  extras from `>=3.12,<4` to `>=3.14.3,<4` (and the matching specifiers in
  uv.lock) so an SDK upgrade cannot retain an aiohttp older than the remediated
  floor. 3.14.3 is the release that clears the disclosed advisories; the lock
  already resolves aiohttp to 3.14.3, so the resolution is unchanged.
- Fix pyright typecheck failures introduced by aiohttp 3.14, which made
  `ClientWebSocketResponse` generic (default `Literal[True]`). Parameterize the
  three annotations in the Cloudflare PTY path to `ClientWebSocketResponse[bool]`
  to match `ClientSession.ws_connect`'s return type, resolving the assignment
  mismatch at sandbox.py:1149 and the cascading Optional-member-access errors.
@aeonframework

Copy link
Copy Markdown
Author

Thanks @seratch, good catch. Fixed in f9f8107:

  • Raised the published aiohttp floor in both the blaxel and cloudflare extras from >=3.12,<4 to >=3.14.3,<4, so an SDK upgrade can no longer retain an aiohttp older than the remediated release. Updated the matching specifiers in uv.lock too; the lock already resolved aiohttp to 3.14.3, so the resolution graph is unchanged.
  • While validating the extras against the upgraded dependency, the typecheck job surfaced a real regression: aiohttp 3.14 made ClientWebSocketResponse generic (default Literal[True]), so the bare annotations no longer matched ClientSession.ws_connect's ClientWebSocketResponse[bool] return. Parameterized the three annotations in the Cloudflare PTY path to [bool], which clears the pyright assignment error at sandbox.py:1149 and the cascading Optional-member-access errors at 1157/1180.

So the published requirements now match the intended remediated floor, and the affected cloudflare extra is type-checked against the actual upgraded aiohttp. Let me know if you'd prefer the floor pinned to an exact ==3.14.3 instead of a >=3.14.3,<4 range.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9f8107620

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread pyproject.toml
realtime = ["websockets>=15.0, <17"]
sqlalchemy = ["SQLAlchemy>=2.0", "asyncpg>=0.29.0"]
encrypt = ["cryptography>=45.0, <46"]
encrypt = ["cryptography>=46.0.7, <47"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Apply the cryptography floor to base installs

When a user upgrades the base openai-agents package without the encrypt extra in an environment containing vulnerable cryptography 45.x, this constraint is never evaluated. The base dependency graph already installs cryptography through mcpPyJWT[crypto], whose looser requirement allows pip to retain 45.x; the lockfile upgrade therefore does not remediate those published installations. Add the safe cryptography>=46.0.7,<47 constraint to the core dependencies (or otherwise constrain the base graph), as was done for transitive urllib3.

AGENTS.md reference: AGENTS.md:L145-L147

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed in 7c54392. Confirmed the transitive path: base dep mcp>=1.19.0 requires pyjwt[crypto], which pulls cryptography into the base graph with no floor of its own, so a base openai-agents upgrade (without the encrypt extra) could retain vulnerable 45.x. Added cryptography>=46.0.7,<47 to the core dependencies (unmarked; the package is requires-python >= 3.10) plus the matching base requires-dist entry in uv.lock, mirroring the urllib3 base-floor already applied for the requests-transitive CVEs. Resolution graph is unchanged (already resolved to 46.0.7).

…pt extra

Addresses the Codex P1 on openai#4829. cryptography reaches the base openai-agents
dependency graph transitively via the core `mcp` dependency -> `pyjwt[crypto]`,
whose own cryptography requirement is unpinned. The bump previously floored
cryptography only in the `encrypt` extra and the dev group, so a base install or
upgrade (no `encrypt` extra) could still resolve/retain vulnerable 45.x, leaving
GHSA-p423-j2cm-9vmq (CVE-2026-39892, CVSS 9.8) unremediated for base users.

Add `cryptography>=46.0.7,<47` to the core dependencies (unmarked; the package is
already `requires-python >= 3.10`) and the matching base requires-dist entry in
uv.lock. This mirrors the urllib3 base-floor already applied for the
requests-transitive CVEs; the lock already resolves cryptography to 46.0.7, so the
resolution graph is unchanged.

@sylvesterkaczmarek sylvesterkaczmarek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed my earlier dependency-floor finding. pyproject.toml now publishes urllib3>=2.7.0,<3, and the lockfile is aligned at 2.7.0, so consumers cannot silently remain on the vulnerable 2.5.0 through requests. My previous blocker is resolved.

@aeonframework

Copy link
Copy Markdown
Author

@seratch following up on this one. The aiohttp lower-bound you flagged should be covered now - the matching floor bump landed and the bot fix comment above reflects it. Could you re-check when you have a moment so this can unblock? Happy to adjust if anything is still off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants