Security: swap pre-sign confirmation labels and SEC-D11 tests (#409) #929
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic!929
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-409-swap-signing-confirmation-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a labeled pre-sign swap summary (
SwapPreSubmitSummary) on/swapand the Trade Market tab so traders see action, pair, pay/receive amounts, max spread, min return, and chain name before the wallet extension opens. Closes the SEC-D11 gap where no frontend test asserted these confirmation fields — phishing substitutions of pair or chain would now fail CI.Tied to #409.
Acceptance checklist
cd frontend-dapp && npm run test:run -- src/pages/SwapPage.test.tsx -t "pre-sign confirmation"swap-confirm-offerswap-confirm-receiveswap-confirm-max-spread(0.5%)swap-confirm-chain(LocalTerra)walletType: 'keplr'npm run test:run -- src/components/swap/__tests__/SwapPreSubmitSummary.test.tsx src/pages/SwapPage.test.tsx src/components/trade/__tests__/TradeMarketOrderPanel.submitSnapshot.test.tsx(27/27)Note: Full
make test-frontendcurrently fails on an unrelated pre-existingcosmesPatch127.test.tspatch-version mismatch on main (@goblinhunt/cosmes@0.0.71-ghunt.22); not introduced by this MR.Verification checklist (third parties)
issue-409-swap-signing-confirmation-tests.make dev→ connect Keplr → enter swap amount → confirm card above Swap shows Action, Pair, You pay, You receive, Max spread, Min return, Chain.docs/frontend.md§ Swap pre-sign summary,skills/AGENTS_FRONTEND_SWAP_SIGNING_CONFIRMATION.md.Security review — MR !929
Commit reviewed:
f08635d0ab94e6130a7696e740fc53b6e592c008Scope:
SwapPreSubmitSummarycomponent, SwapPage / TradeMarketOrderPanel wiring, SEC-D11 tests, docs/skills updates.Outcome
FINDINGS: 0 medium+
Security review: no medium+ findings on this diff.
Analysis summary
Reviewed added/modified frontend paths for injection, authz bypass, confirmation-vs-submit mismatches, XSS, and trust-boundary regressions.
SwapPreSubmitSummaryrenders all dynamic values as React text nodes ({value}); nodangerouslySetInnerHTML. Token symbols flow through existinggetTokenDisplaySymbol(same surface as pre-MR swap UI).useSubmitAlignedSimQuote(simData,minReceived). Submit remains gated bysimQuoteStale/isSubmitReadyandassertSubmitQuotePayRawAlignedin mutation paths (#356). Brief debounce windows may show a stale quote while submit is disabled — not exploitable.chainFullLabelfrom build-timegetNetworkBadgeCopy();actionLabelhardcoded (Swap/Market swap). Not attacker-controlled.Inline threads
None (no medium+ findings).
Prior review
No prior security-review notes on this MR; nothing to re-report.
mentioned in commit
049471ed2a