verification with real SEP-10 signature verification#19
Open
Johnsource-hub wants to merge 2 commits into
Open
Conversation
DeFiVC
requested changes
Jun 20, 2026
DeFiVC
left a comment
Contributor
There was a problem hiding this comment.
The SEP-10 implementation approach is correct and addresses the security vulnerability from #4, but the PR introduces multiple breaking changes that cause the CI typecheck failure.
Blocking Issues
- ❌ CI Failure —
npm run typecheckfails (PR code, not pre-existing) - ❌ Removed exports break dependents —
authService,ChallengeBody,VerifyBodyremoved from exports but imported byauth.controller.ts:2-3. Schema renames (challengeSchema/verifySchema→ChallengeRequestSchema/VerifyRequestSchema) breakauth.routes.ts:4. - ❌ Broken import paths — PR changes to non-existent paths (
../../stellar/client,../../database) and drops.jsextensions required by ESM config. - ❌ Duplicate
UnauthorizedError— Creates local class instead of importing from../../utils/errors.js.
Code Issues
auth.service.ts:47—token: "mock-session-jwt-placeholder"should staytoken: ""(controller sets real JWT)..startsWith("G")validation removed from address schemas — Stellar public keys must start with G.- Logger import/usage stripped — should be preserved.
What's Good
- Correct SEP-10 architecture: real TransactionBuilder with manageData, XDR decoding, Keypair.verify()
- Proper replay protection: time bounds, single-use Redis deletion, operation validation
- Directly addresses issue #4's security requirements
Please fix the broken imports/exports, restore removed functionality, and ensure npm run typecheck passes.
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.
#closes
#4
Description
This PR closes an identity verification bypass vulnerability inside the
authmodule by replacing the simplified token text lookups with formal, cryptographic SEP-10 standard signature verification.Technical Blueprint & Security Protections
createChallengeto emit real, un-executed Stellar base transactions containing transaction-level random challenge nonces mapped viamanageDataoperation layers.verifyChallengeto evaluate raw transaction hashes directly against the public address keypair using the official@stellar/stellar-sdk.timeBounds), enforce localized source matching bounds, and explicitly perform single-use token deletion viaredis.del().Affected Path Boundaries
src/modules/auth/auth.service.tssrc/modules/auth/auth.types.tsVerification & Integrity Checklists