fix(security): repair pre-existing CI baseline (passkey replay gate + hook tests) - #280
Open
cypriannwokolo2-creator wants to merge 2 commits into
Open
fix(security): repair pre-existing CI baseline (passkey replay gate + hook tests)#280cypriannwokolo2-creator wants to merge 2 commits into
cypriannwokolo2-creator wants to merge 2 commits into
Conversation
…ze hook tests - register/auth-verify: the temp-challenge replay gate was called without await, so a pending Promise was always truthy and verification was silently bypassed (replay risk). Now awaited on both routes. - auth-verify: counter updates mutated a throwaway copy from getCredential(); persist via new updateCredentialCounter() (local map + best-effort backend sync). - routes.test.ts: fixtures store credentials with userId (ownership check is intentional); unique per-request IPs stop rate-limit cross-test cascade; heavy PBKDF2 (600k iters, OWASP) mocked at module boundary to keep tests fast. - hook tests: drop beforeEach mockReset (breaks hoisted vi.mock factories in vitest v4); use mockRejectedValue instead of setTimeout(reject) which escaped act(). Fixes #279
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…RL in SSR) Relative-URL fetch at module import crashes Node's fetch whenever the module is imported server-side (SSR/prerender/route handlers), spamming WebServer logs and breaking E2E boots. The key is client-only by design; server-side now skips the fetch and degrades exactly like a failed fetch did.
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.
Fixes #279
Security fixes (code, not assertions)
getAndVerifyTempChallenge()was neverawaited in register/auth-verify — a pending Promise is truthy, so challenge/replay verification silently passed for ANY input. Now awaited. (This is why auth-verify returned 200 for never-stored challenges.)getCredential(). AddedupdateCredentialCounter()(local map + best-effort backend PATCH).Test repairs
userId(route's ownership check is intentional and kept).beforeEach(mockReset)(vitest v4 + hoisted factory issue);mockRejectedValueinstead ofsetTimeout(reject).Verified locally