Frontend trust boundaries, build guards, and expert mode (#378) #902
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!902
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-378-frontend-trust-boundaries"
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
Implements GitLab #378 (remediation bundle for #376): hardens frontend off-chain trust boundaries without on-chain hop cross-checks.
VITE_INDEXER_URL; existing swap route summary unchanged.vite buildrejectsVITE_DEV_MNEMONICoutsidedevelopmentmode (escape:VITE_ALLOW_DEV_MNEMONIC=local-only).connect-srcto LCD/RPC/indexer + WalletConnect; bootstrap scripts moved to/bootstrap/*.js(script-src 'self'). Dev keeps broader policy for Vite HMR./protocolaudit panel only; optionaldeployAddressVerification.tsdocumented.tokenLogoAllowlist.ts); untrusted URLs fall back to blockie; ops doc for human-reviewed indexer listings.vite buildrequiresVITE_WC_PROJECT_ID; dev-only WC default inwallet.ts.ENABLE EXPERT MODE; 30%/50% slippage thresholds unchanged.Docs:
security-model.md,frontend.md,operator-secrets.md,launch-checklist.md,skills/AGENTS_FRONTEND_TRUST_BOUNDARIES.md.Acceptance checklist
docs/security-model.md,docs/runbooks/launch-checklist.mdPhase 4vite buildfails on dev mnemonic outside developmentVITE_DEV_MNEMONIC=… npx vite build --mode staging→ errorvite buildfails on missing WC project ID in productionunset VITE_WC_PROJECT_ID; npx vite build --mode production→ errorhttps:connect-src in production)viteConfig.build.test.tsCSP tests;render.yamlheadersProtocolPage.tsxdata-testid="protocol-deploy-addresses"tokenLogoAllowlist.test.ts;operator-secrets.mdExpertModeModal.test.tsx,swapRouteSlippage.tsconstantsmake test-frontend(997 tests)make lint-frontend(0 errors)Third-party verification
Manual (optional):
make dev→/protocolshows factory/router; swap expert mode requires typing phrase; evil logo URL shows blockie.Blockers
None.
changed the description
changed the description
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issues.
Reviewed by Cursor Bugbot for commit
b45ac0aea6. Configure here.Deploy address verify never runs
Medium Severity
verifyDeployAddressesOnLcdis documented and env-gated viaVITE_VERIFY_DEPLOY_ADDRESSES, but nothing in the app reads that flag or calls the function at startup, so operators get no LCD mismatch warning when they enable the option.Reviewed by Cursor Bugbot for commit
b45ac0aea6. Configure here.Render CSP omits indexer host
High Severity
The static host
Content-Security-Policyconnect-srclists LCD, RPC, and WalletConnect origins but not the production indexer API. Browsers enforce CSP from both the response header and the builtindex.htmlmeta tag, so cross-origin indexer fetches fail on Render even when the bundle’s meta policy includesVITE_INDEXER_URL.Reviewed by Cursor Bugbot for commit
b45ac0aea6. Configure here.Security review — MR !902
Commit reviewed:
b45ac0aea60c370b1097a42a4677a9c14bbb0dbbScope: Frontend off-chain trust boundaries (#378): build-time guards (
VITE_DEV_MNEMONIC,VITE_WC_PROJECT_ID), production CSP narrowing, bootstrap script externalization, token logo host allowlist, expert-mode typed confirmation,/protocoldeploy-address audit panel, optionaldeployAddressVerification.ts, docs/runbooks.Outcome:
FINDINGS: 0medium+Summary: Reviewed added/modified code and traced attacker-controlled inputs (indexer
logo_url, token logo URIs, expert-mode UI input, build env) to sinks (fetch/CSP/img src/localStorage). Changes are defensive: production CSP drops blankethttps:/unsafe-inlinescripts, build guards block dev mnemonic and shared WalletConnect ID in production bundles, token logos require HTTPS allowlisted hosts with blockie fallback, andTokenLogore-validates URLs passed from callers.Prior threads reviewed: Bugbot flagged Render CSP missing indexer host (availability/deployment — not an exploitable trust-boundary bypass) and unwired
verifyDeployAddressesOnLcd(optional mitigation never hooked — no new attack path). Neither meets medium+ security criteria on this diff.Inline findings: None.
Security review: no medium+ findings on this diff.
changed this line in version 2 of the diff
added 1 commit
ec409fde- fix: align Render CSP with build indexer origin and run deploy verifyCompare with previous version
changed the description
resolved all threads
resolved all threads
mentioned in commit
0607c11a78