Skip to content

security(deps): upgrade oauth2 to 5.0 and reqwest to 0.12 - #30

Merged
vietanhdev merged 4 commits into
mainfrom
deps/oauth2-reqwest-upgrade
Jul 20, 2026
Merged

security(deps): upgrade oauth2 to 5.0 and reqwest to 0.12#30
vietanhdev merged 4 commits into
mainfrom
deps/oauth2-reqwest-upgrade

Conversation

@vietanhdev

Copy link
Copy Markdown
Owner

Clears all three rustls-webpki advisories — RUSTSEC-2026-0099, -0098 and -0104, the last being a reachable panic in CRL parsing.

Verified: cargo audit passes with only the rmcp exemption, and that one is cleared separately by #29.

Why both at once

oauth2 4.4 pins reqwest 0.11 → rustls 0.21 → the vulnerable rustls-webpki. Upgrading either alone changes nothing.

One API change worth calling out

request_async no longer takes the crate's own async_http_client; the caller supplies a reqwest client. That's security-relevant, not mechanical: 4.x disabled redirects internally, and 5.x hands the decision over.

oauth_http_client() sets redirect::Policy::none() explicitly. Following redirects on a token endpoint opens the client to SSRF — the oauth2 docs call this out — and silently inheriting reqwest's default of following up to 10 would have been a real regression introduced by an otherwise routine upgrade.

The other change is mechanical: the four-argument BasicClient::new became a builder, and which endpoints are configured is now encoded in the type.

Exemptions removed

Both taken out of ci.yml rather than left in place. Only the unmaintained gtk-rs GTK3 warnings remain, and those come from Tauri's own tree.

Not exercised at runtime

Google sync needs credentials this build doesn't have, since the OAuth client was deleted. Build, clippy and the full suite pass; the flow gets its first real run when sync is restored with a new PKCE client.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 19, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
thinkutils 11e1a0e Jul 20 2026, 02:52 AM

Clears all three rustls-webpki advisories -- RUSTSEC-2026-0099, -0098 and
-0104, the last being a reachable panic in CRL parsing. Verified: cargo
audit passes with only the rmcp exemption, and that one is cleared
separately by the rmcp 2 upgrade.

The two had to move together. oauth2 4.4 pins reqwest 0.11, which pins
rustls 0.21, which pins the vulnerable rustls-webpki. Upgrading either
alone changes nothing.

API changes in oauth2 5.0:

  The four-argument BasicClient::new is replaced by a builder, and which
  endpoints are configured is now encoded in the type -- hence the
  EndpointSet/EndpointNotSet parameters on create_oauth_client's return
  type.

  request_async no longer takes the crate's own async_http_client; the
  caller supplies a reqwest client. That is a security-relevant change
  rather than a mechanical one: 4.x disabled redirects internally, and
  5.x hands the decision over. oauth_http_client() sets
  redirect::Policy::none() explicitly, because following redirects on a
  token endpoint opens the client to SSRF -- the oauth2 docs call this
  out, and silently inheriting reqwest's default of following up to 10
  would have been a real regression.

Both exemptions removed from ci.yml rather than left in place. Only the
unmaintained gtk-rs GTK3 warnings remain, and those come from Tauri's own
dependency tree.

Not exercised at runtime: Google sync needs credentials this build does
not have, since the OAuth client was deleted. Build, clippy and the full
suite pass; the flow gets its first real run when sync is restored with a
new PKCE client.
@vietanhdev
vietanhdev force-pushed the deps/oauth2-reqwest-upgrade branch from 54e6490 to 59a6d24 Compare July 19, 2026 16:19
The guard grepped ci.yml for '--ignore RUSTSEC' to catch undocumented
advisory exemptions, but its own command line contains that literal, so
it matched itself and failed unconditionally.

It was also redundant. A bare 'cargo audit' with zero exemptions already
IS the property the guard was checking, and adding an --ignore is a
visible diff to this file. Folded the reasoning into a comment above the
step and removed the stale block that still claimed two clusters were
ignored -- they were cleared by rmcp 2 and oauth2 5 / reqwest 0.12.

Verified: cargo audit exits 0 with no exemptions (17 unmaintained/unsound
gtk-rs warnings remain, which it does not fail on).
husky v9 prints a deprecation warning on every commit for the shebang and
the husky.sh source line, and says outright they WILL FAIL in v10. The
runner supplies both now, so the hook only needs its own body.

Also replaced the $? check with 'if ! npx lint-staged', which is the same
test without depending on $? surviving the intervening lines.
oauth2 4.x disabled redirects inside its own async_http_client; 5.x hands
that decision to the caller, so the SSRF guard now lives in our code and
nothing enforces it. Swapping oauth_http_client() back to
reqwest::Client::new() compiles cleanly and silently reopens the hole.

Asserts the behaviour instead of the construction: a local server returns
302, and the test requires it to arrive as a 302 with the redirect target
never requested. Verified by mutation -- removing .redirect(Policy::none())
fails the test with 200 != 302.
@vietanhdev
vietanhdev merged commit 93496bd into main Jul 20, 2026
9 of 10 checks passed
@vietanhdev
vietanhdev deleted the deps/oauth2-reqwest-upgrade branch July 20, 2026 03:02
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