Skip to content

[BE-W3A-103] Web3 Signature Security and Auditing - Step 103#650

Merged
soomtochukwu merged 3 commits into
DXmakers:mainfrom
Johnpii1:fix-conflit
May 29, 2026
Merged

[BE-W3A-103] Web3 Signature Security and Auditing - Step 103#650
soomtochukwu merged 3 commits into
DXmakers:mainfrom
Johnpii1:fix-conflit

Conversation

@Johnpii1
Copy link
Copy Markdown
Contributor

close #457

Description
Added a hardened auth router via createAuthRouter with strict request boundaries using zod, injectable AuthRouteState, and secure session cookie defaults (sessionCookieOptions).
Implemented canonical Stellar address validation (sanitizeStellarAddress) using StrKey decode/encode and checksum checks, bounded signature decoding (extractSignatureBytes), SEP-53-style signature verification (verifyStellarSignature) and challenge construction (buildChallenge).
Enforced atomic one-time nonce consumption by checking auth_challenges.deleteMany(...) before minting sessions and added Redis-backed revocation helpers (isSessionRevoked, revokeSession) with a 1ms lookup budget and a getDefaultRedisClient helper.
Wired session endpoints: /challenge, /verify, /session, and /logout, updated package.json test script, and added comprehensive node:test coverage in backend/tests/auth.test.ts covering address checksums, signature verification, challenge freshness, Redis timing, and replay prevention.

Testing
Ran npm test which executed the new node:test suite and all tests passed (5/5 tests passed).
Attempted npm run build; this currently fails due to existing TypeScript/Prisma issues outside this change (missing PrismaClient export from @prisma/client and several pre-existing implicit any errors in other routes), so build is not green at repository level.

@Johnpii1 Johnpii1 requested a review from soomtochukwu as a code owner May 29, 2026 14:16
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

@Johnpii1 is attempting to deploy a commit to the mAzI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@Johnpii1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@soomtochukwu soomtochukwu merged commit 776a2f6 into DXmakers:main May 29, 2026
2 of 4 checks passed
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.

[BE-W3A-103] Web3 Signature Security and Auditing - Step 103

2 participants