Security: limit order pre-sign modal missing chain label before wallet dialog opens [SEC-I05] (F02) #461
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#461
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?
Summary
The swap pre-sign summary card (
SwapPreSubmitSummary.tsx) displays action, pair tokens, amounts, max spread, min return, and chain label before the Keplr wallet dialog appears. The limit order pre-sign path shows fee and deviation only. No in-app chain anchor (chain name, chain ID, or network badge) is surfaced before the wallet dialog for limit order placement. A phishing page substituting a different chain could display the same limit order form without the user seeing the chain name before they approve in Keplr.What Was Checked
frontend-dapp/src/components/swap/SwapPreSubmitSummary.tsx: renderschainFullLabelfromgetNetworkBadgeCopy().fullLabelbefore wallet dispatch.frontend-dapp/src/pages/LimitOrdersPage.tsxline 703 andfrontend-dapp/src/components/trade/TradeOrderTicket.tsxline 831: pre-sign entry points for limit order placement. No equivalent pre-sign summary card with chain label found.frontend-dapp/src/components/trade/TradeOrderTicket.tsx: renders fee estimate and price deviation before submit, but not chain, pair address, or network badge.Expected (per checklist)
All transaction types (swap, limit order, provide, withdraw) show at minimum the chain label and action type in an in-app confirmation card before the wallet dialog opens, consistent with the SEC-D11 anti-phishing protection applied to swaps.
Actual
Limit order placement has no pre-sign summary card with chain label. The first explicit chain identification the user sees is inside the Keplr dialog.
Suggested Fix
Add a pre-sign summary step to
TradeOrderTicket.tsxandLimitOrdersPage.tsxthat surfaces: action ("Place Limit Order"), pair, side (buy/sell), amount, price, and chain label before dispatching the Keplr signing request. Reuse or extendSwapPreSubmitSummaryor createLimitOrderPreSubmitSummaryfollowing the same pattern.Verification Checklist
getNetworkBadgeCopy().fullLabel(same as swap summary)Cc: @PlasticDigits
mentioned in issue #454
mentioned in issue #381
mentioned in merge request !989
Fixed. The limit-order pre-sign card (
LimitOrderPreSubmitSummary) already exists and shows deviation + maker fee + network fee, but had no in-app chain anchor — so the first chain identification during limit placement was the Keplr dialog.Added a Chain row deriving from
getNetworkBadgeCopy().fullLabel(same source the swap pre-sign card uses), via a new optionalchainFullLabelprop defaulting to the env badge. The card is already rendered inTradeOrderTicketbefore the place dispatch, so the chain anchor now shows pre-wallet on the limit path too.Tests: new case asserts the
-chainrow renders the label; component suite 4/0, tsc clean. Source + unit verified here; the before-the-wallet-dialog placement is a laptop browser confirmation.MR !989, branch
qa/461-limit-presign-chain-label, commit8ca9eb51. Needs review/merge @PlasticDigits — leaving open for verification.mentioned in commit
b803ac105bFix needs review to reduce user cognitive overload
mentioned in commit
16d19e715amentioned in merge request !995
mentioned in commit
79943b6df1mentioned in commit
b2b067ec8fmentioned in merge request !997
mentioned in commit
4dad91d80dmentioned in merge request !991
mentioned in commit
ee5f71d8bamentioned in merge request !1000
mentioned in commit
4f4f4de102Verification — #461 (SEC-I05 F02)
Result: PASS — fix on
main(LimitOrderPreSubmitSummarychain anchor; MR !989 + follow-upee5f71d8).Checklist
LimitOrderPreSubmitSummary.tsxrenders Action/Pair/Side/Amount/Chain rows; mounted inLimitOrdersPage.tsxandTradeOrderTicket.tsxbefore Place dispatchgetNetworkBadgeCopy().fullLabel(same as swap)chainFullLabel = getNetworkBadgeCopy().fullLabelinLimitOrderPreSubmitSummary.tsx(mirrorsSwapPreSubmitSummary.tsx)npm test -- --run src/components/trade/__tests__/LimitOrderPreSubmitSummary.test.tsx→ 5/5 pass, including#461case on-chainrowLimitOrdersPage.test.tsx(limits-page-pre-submit-summary-chain→LocalTerra),TradePage.test.tsx(trade-limit-pre-submit-summary-chain→LocalTerra); Playwright smoke on LocalTerra/limits— pre-submit card visible with “Review these fields before your wallet opens” and chain row before Place limit (Simulated Wallet)Commands run
Follow-up
@PlasticDigits noted the card may still feel cognitively heavy (deviation + maker fee + network fee alongside the new chain anchor). Consider a follow-up UX pass to tighten copy/layout while keeping the SEC-D11 chain anchor visible.