Frontend trust boundaries, build guards, and expert mode (#376) #378
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#378
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?
Parent
Remediation bundle for #376 — Full security report.
Covers approved findings: H-04, H-05, M-07, M-08, M-09, M-10, M-15 (audit ID M-14).
Current codebase
frontend-dapp/src/pages/SwapPage.tsxandsrc/services/indexer/routeOperations.tstrust indexerrouter_operationsafter parsing;swapRoutePreflight.tsvalidates hop pairs via factory LCDgetPair(). Route summary row exists (data-testid="swap-route-summary").VITE_INDEXER_URLdefaults tohttp://127.0.0.1:3001insrc/services/indexer/client.ts. No dedicated off-chain trust documentation.frontend-dapp/vite.config.tsL51–59 blocksVITE_DEV_MNEMONIConly forbuild && mode === 'production'. Staging/non-prod builds can still inline mnemonic.frontend-dapp/index.htmlL18–19 usesscript-src 'self' 'unsafe-inline'and broadconnect-src … https: wss:.render.yamlmirrors policy.frontend-dapp/src/utils/constants.tsreadsVITE_FACTORY_ADDRESS,VITE_ROUTER_ADDRESSwith public-node fallbacks. No startup LCD verification.ProtocolPage.tsxdoes not display factory/router addresses.useTokenDisplayInfo.tsuses indexerlogo_url;TokenLogo.tsxrenders raw<img src>with no host allowlist.docs/CG_CMC_COMPLIANCE.mdcovers manual CMC listing only.frontend-dapp/src/services/terraclassic/wallet.tsL37 falls back to shared default project ID whenVITE_WC_PROJECT_IDunset.swapRouteSlippage.tsblocks >30% route slippage unless expert mode.ExpertModeModal.tsxuses click-to-enable disclaimer; no typed confirmation. 50% slippage tolerance allowed in settings for expert users.Why needed
Off-chain trust boundaries (indexer, build env, token metadata) can mislead users into signing degraded or malicious transactions. Build misconfiguration can leak dev keys. Approved fixes harden build guards, document indexer trust, tighten CSP/WC, and add expert-mode friction without on-chain hop cross-checks.
Constraints / guardrails
/protocol) — not in swap confirmation UI (cognitive overload).Relevant files
frontend-dapp/src/pages/SwapPage.tsx,src/services/indexer/routeOperations.ts,src/services/indexer/client.ts,src/services/terraclassic/swapRoutePreflight.ts,src/utils/swapRouteDisplay.tsfrontend-dapp/vite.config.ts,src/services/terraclassic/devWallet.ts,src/viteConfig.build.test.tssrc/services/terraclassic/wallet.ts,src/utils/constants.tssrc/hooks/useTokenDisplayInfo.ts,src/components/ui/TokenLogo.tsxsrc/components/swap/ExpertModeModal.tsx,src/utils/swapRouteSlippage.ts,src/utils/expertMode.tsfrontend-dapp/index.html,render.yamlsrc/pages/ProtocolPage.tsxdocs/frontend.md,docs/security-model.md,docs/operator-secrets.mdRecommended direction
docs/security-model.md§ off-chain trust (MITM, compromised indexer, malicious but valid pools). Deploy checklist: HTTPS-onlyVITE_INDEXER_URL, TLS cert pinning guidance. Polish hop summary in swap confirmation (existing route row + pre-submit breakdown).vite buildwhenVITE_DEV_MNEMONICis set unlessmode === 'development'or explicitVITE_ALLOW_DEV_MNEMONIC=local-only. ExtendviteConfig.build.test.ts.connect-srcto env-specific LCD/RPC/indexer hosts.ProtocolPage(audit/settings only).TokenLogo/ logo URI resolver; ops doc confirming indexer token listing requires human review.VITE_WC_PROJECT_IDmissing (mirror H-05 pattern invite.config.ts).ExpertModeModalbefore enabling expert mode; unit/E2E tests.Acceptance criteria
vite buildfails on dev mnemonic outside development mode; fails on missing WC project ID in production.https:connect-src in production); documented dev exception.Test plan
make test-frontend/make lint-frontendfrontend-dapp:viteConfig.build.test.ts(staging mnemonic rejection, WC ID guard)TokenLogoallowlist,ExpertModeModaltyped confirmmake verify-issue-295or targeted Playwright if swap confirmation UI changesmake dev→ verify route summary, protocol page addresses, expert mode flowAttack / abuse test plan
vite build --mode stagingwithVITE_DEV_MNEMONICset — must fail.VITE_WC_PROJECT_ID— must fail.https://evil.example/logo.png— must fall back to blockie.Verification criteria
mentioned in issue #376
mentioned in commit
b45ac0aea6mentioned in merge request !902
mentioned in commit
ec409fde96mentioned in commit
0607c11a78mentioned in commit
525056e0ffmentioned in merge request !906
mentioned in commit
4e06ee3688mentioned in commit
171aa60b58mentioned in commit
eaecea2462mentioned in merge request !909
mentioned in commit
dd654b11f5mentioned in commit
01b1b664e2mentioned in commit
d7aa33e895mentioned in commit
8acee13f41mentioned in merge request !908
mentioned in issue #422
mentioned in merge request !951
mentioned in issue #337
mentioned in merge request !953
mentioned in issue #541
mentioned in issue #542
marked as related to #542
mentioned in issue #550
marked as related to #550
mentioned in issue #554
mentioned in issue PlasticDigits2/ustr-cmm#17
mentioned in issue #566
mentioned in issue #569
mentioned in issue #570
mentioned in issue #652
mentioned in issue #656
mentioned in issue #693
mentioned in issue #695
marked as related to #695
mentioned in merge request !1192
mentioned in issue #706
mentioned in issue #715