Defend against confusable/homoglyph and bidi-override address & solver-name spoofing - #357
Open
LoneWolfxm wants to merge 2 commits into
Open
Defend against confusable/homoglyph and bidi-override address & solver-name spoofing#357LoneWolfxm wants to merge 2 commits into
LoneWolfxm wants to merge 2 commits into
Conversation
… 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.
security: XDR review, CSV injection, CSP headers, Unicode sanitization (stellar-vortex-protocol#244–stellar-vortex-protocol#247)
|
@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! 🚀 |
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.
Summary
Closes #
Changes
Testing
npm run buildpassesnpx tsc --noEmitpassesnpm testpasses (or note any skipped/unrelated failures)Checklist
feat:,fix:,chore:, etc.)closes Add an explicit transaction review step before Freighter signing #244
closes Harden CSV export against formula injection #245
closes Add CSP and other security headers via next.config.mjs #246
closes Defend against confusable/homoglyph and bidi-override address & solver-name spoofing #247