Security: no frontend tests assert signing confirmation labels for action, pair, amount, max spread, min return, or chain [SEC-D11] #409
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#409
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Checklist Item
SEC-D11: Model frontend wallet phishing/signing confusion. Verify: wallet signing UI clearly names action, pair, amount, max spread/min return, and chain; tests assert dangerous action labels.
Summary
The dApp's dangerous-slippage guard and expert mode opt-in flow are tested:
swap-extreme-slippage-warning,swap-slippage-blocked, and the disabled "Slippage is too high" button are all asserted inSwapPage.test.tsx, andExpertModeModal.test.tsxconfirms the phrase confirmation requirement. The remaining gap is that no test asserts the pre-signing confirmation panel displays the action type, selected pair tokens, offer and return amounts, max spread or min return value, or chain name as individually labeled fields visible to the user before the Keplr signing request is dispatched.What Was Checked
frontend-dapp/src/pages/SwapPage.test.tsxlines 541-554:swap-expected-slippagecontent ("100.00%"),swap-slippage-blocked, button "Slippage is too high" disabled,swap-extreme-slippage-warning, and expert mode activation flow all confirmed by direct file read -- dangerous-slippage guard IS testedfrontend-dapp/src/components/swap/ExpertModeModal.test.tsx: correct phrase required, wrong phrase rejected -- expert mode modal IS testedfrontend-dapp/src/pages/SwapPage.test.tsxlines 398, 459:swap-route-summarytestid asserted -- route display IS testedfrontend-dapp/src/pages/SwapPage.test.tsxandTradePage.test.tsx: direct file read found no test asserting action label, pair token symbols, offer amount, return amount, max spread, or chain name as labeled confirmation-panel fieldsExpected (per checklist)
Frontend tests must assert that the pre-signing confirmation panel clearly displays: action type ("Swap"), the selected pair token symbols, the offer amount, the expected return amount, the max spread or min return value, and the chain name.
Actual
The dangerous-slippage guard and expert mode flow are well tested. The route display (
swap-route-summary) is tested. No test asserts that the confirmation panel shows action type, pair token symbols, offer amount, return amount, max spread value, or chain name as labeled fields. A phishing scenario substituting a wrong pair or chain address in the displayed confirmation would not be caught by the existing test suite.Evidence
frontend-dapp/src/pages/SwapPage.test.tsxlines 541-554: dangerous-slippage guard and expert mode flow confirmed tested by direct file readfrontend-dapp/src/components/swap/ExpertModeModal.test.tsx: expert mode modal confirmed testedfrontend-dapp/src/pages/SwapPage.test.tsx: no test found asserting action label, pair token symbols, offer amount, return amount, max spread, or chain name in a labeled confirmation-panel contextfrontend-dapp/src/pages/TradePage.test.tsx: same -- no confirmation-panel field label testsSuggested Fix
Add unit tests (Vitest + Testing Library) that render the swap confirmation panel with a mocked quote and assert each of the following is visible and labeled: action type ("Swap"), offer token symbol and amount, return token symbol and estimated amount, max spread percentage, and chain name. These tests target the in-dApp confirmation step before the Keplr signing dialog opens.
Verification Checklist
Labels
security,pre-launchCc: @PlasticDigits
mentioned in issue #381
mentioned in commit
f08635d0abmentioned in merge request !929
mentioned in commit
049471ed2aVerification — SEC-D11 signing confirmation labels (#409)
All acceptance criteria are already satisfied on
main(merged viaf08635d0/ MRissue-409-swap-signing-confirmation-tests). No additional code changes were required in this pass.What was verified
SwapPreSubmitSummary.test.tsxassertsswap-confirm-action→Swap;SwapPage.test.tsxintegration test with Keplr wallet contextswap-confirm-offerasserted in unit +SwapPageintegration testsswap-confirm-receiveasserted in unit + integration testsswap-confirm-max-spreadasserts0.5%swap-confirm-chainassertsLocalTerraswap-confirm-min-returnasserted (issue checklist focused on max spread; both are covered)swap-confirm-pairassertedTradeMarketOrderPanel.submitSnapshot.test.tsxassertsMarket swapaction + allswap-confirm-*fieldsSwapPage.test.tsxsetswalletType: 'keplr'in pre-sign panel describe blockCommands run
Result: 3 test files, 27 tests — all passed.
Implementation summary (on
main)frontend-dapp/src/components/swap/SwapPreSubmitSummary.tsx— labeled rows withswap-confirm-action,swap-confirm-pair,swap-confirm-offer,swap-confirm-receive,swap-confirm-max-spread,swap-confirm-min-return,swap-confirm-chainSwapPage.tsx(pre-submit) andTradeMarketOrderPanel.tsx(market tab,trade-market-pre-submit-summary)skills/AGENTS_FRONTEND_SWAP_SIGNING_CONFIRMATION.mddocs/frontend.md§ Swap pre-sign summary;docs/security-model.mdcross-referenceClosing this issue — SEC-D11 regression coverage is in place.
mentioned in issue #414
mentioned in merge request !940
mentioned in issue #567
mentioned in issue #711