Repository navigation
fix(api): Sign in with CoinPay sends PKCE + nonce; Connect/Disconnect in settings - #173
Merged
Merged
Conversation
… in settings The CoinPay client (cp_56ff186e…) never sent PKCE, so it had to stay in CoinPay's legacy mode. Now, via @profullstack/coinpay-onboard/oauth 0.3.1: - start: PKCE S256 + state + nonce, kept in one httpOnly cookie scoped to /api/auth/coinpay; scopes exactly openid profile email (the old request asked for did + wallet:read, which the client was never registered for, so CoinPay dropped them; sign-in only uses the sub). - callback: constant-time state check; code exchange with the verifier and the client secret (client_secret_post only, not both methods); id_token iss/aud/exp/nonce checked and the userinfo sub matched. - Sub binding unchanged (#171): a CoinPay login never claims an account by email. - New: Settings -> Connect CoinPay (signed in only) / Disconnect (refused when the account has no password). /api/auth/me reports both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
ThreatCrush Security Scan51 finding(s) HIGH/CRITICAL: 2 | MEDIUM: 28 | LOW: 21
…and 1 more. Full results in the Security tab. Snippets are redacted; ThreatCrush never prints matched credential material. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Audit of Sign in with CoinPay against the house relying-party pattern and the STANDING sub rule.
Already right (#171): binds to the CoinPay
sub; the CoinPay email never links to an existing account, is never marked verified, and a password signup can reclaim it; no admin/plan from it.Fixed here (so client
cp_56ff186e…can leave CoinPay's legacy mode):@profullstack/coinpay-onboard/oauth0.3.1); pending request in one httpOnly cookie scoped to/api/auth/coinpay.openid profile email. The olddid wallet:readwere never registered on the client, so CoinPay had been dropping them./api/auth/meaddscoinpayConnected,canDisconnectCoinpay.Note: bumping coinpay-onboard 0.2.0 → 0.3.1 brings zod 4.6.7, which the langchain packages now resolve as their zod peer (they accept ^3.25 || ^4). Typecheck + all API tests pass.
Tests:
services/apivitest 126 pass (new: connect needs a session, linked-elsewhere/already-connected refused, authorize URL has S256/state/nonce, forged state, wrong nonce, pending cookie), tsc clean, eslint 0 errors.🤖 Generated with Claude Code