Skip to content

Defend against confusable/homoglyph and bidi-override address & solver-name spoofing - #357

Open
LoneWolfxm wants to merge 2 commits into
stellar-vortex-protocol:mainfrom
LoneWolfxm:main
Open

Defend against confusable/homoglyph and bidi-override address & solver-name spoofing#357
LoneWolfxm wants to merge 2 commits into
stellar-vortex-protocol:mainfrom
LoneWolfxm:main

Conversation

@LoneWolfxm

Copy link
Copy Markdown

Summary

Closes #

Changes

Testing

  • npm run build passes
  • npx tsc --noEmit passes
  • npm test passes (or note any skipped/unrelated failures)

Checklist

… sanitization

Issue stellar-vortex-protocol#244 - XDR transaction review before Freighter signing
- Add src/lib/xdrReview.ts with decodeXdr(), validateSwapXdr(),
  validateRegistrationXdr(), and XdrMismatchError
- Insert 'reviewing' status step in useSwapSubmission and
  useSolverRegistration between 'building' and 'awaiting-signature'
- Hard-stop on XDR decode failure or destination/amount mismatch;
  freighterApi.signTransaction is never called on invalid XDR

Issue stellar-vortex-protocol#245 - Harden CSV export against formula injection
- Update escapeCsv() in src/lib/csv.ts to prefix cells starting with
  =, +, -, @, tab, or CR with a leading apostrophe (OWASP mitigation)
- Add src/lib/csv.test.ts with explicit malicious-input test cases

Issue stellar-vortex-protocol#246 - Add CSP and security headers via next.config.mjs
- Add headers() export with Content-Security-Policy, X-Frame-Options:
  DENY, X-Content-Type-Options: nosniff, Referrer-Policy, and
  Permissions-Policy on all routes
- API/WS origins dynamically read from process.env; dev mode adds
  HMR WebSocket allowance only

Issue stellar-vortex-protocol#247 - Defend against Unicode bidi/zero-width address spoofing
- Add src/lib/textSafety.ts with sanitizeDisplayText() stripping
  bidi override (U+202A-202E, U+2066-2069) and zero-width/invisible
  characters (U+200B-200D, U+FEFF, U+00AD)
- Apply to all solver name and address rendering surfaces:
  ActivityFeed, CopyButton, ConnectWalletButton, SolvePageClient,
  solve/[address]/page, explore/[id]/page, ExplorePageClient,
  my-intents/page
- Add src/lib/textSafety.test.ts with real Unicode attack fixtures

Also fix pre-existing missing imports (CopyButton, SkeletonCard,
isValidStellarPublicKey) in solve/[address]/page.tsx and
explore/[id]/page.tsx.

Update docs/security-audit.md with mitigations for all four issues.
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@LoneWolfxm 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant