security(route-tax): preserve router trust across upgrades and revoke obsolete settlement authority #1388
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#1388
Loading…
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 and severity
High availability; conditional settlement defense in depth. The current write-once trust model can halt existing taxed routes during router replacement and provides no standard recovery/revocation path; upgrade attestation must distinguish actual funded code.
Internal review references: SBHIGH-01/02; KIMIK3 RT-5, OPS-06, IX-2; chains A/T. Investigated against source revision
748579ab718026efad54afcef4b2a5186fe82662on 2026-10-04. These are engineering findings, not third-party audit certification. Only technical findings and synthetic test cases are included; no conversation, user identity, credentials or real-user activity is published.Current codebase and evidence
community-tax-tokenstampsCONFIG.routerandPROTOCOL_EXEMPTduring instantiate/adoption. Same-crate migrate rejects adoption and only updates cw2; settings and execute expose no router rotation. Router preview requires the token's configured router to match the active router. Replacing the router address therefore makes existing taxed routes unavailable until new token recovery code is deployed. Current rollout prose does not explicitly require in-place migration. The existing read-only probe already checks funding version/router equality and fails with --expect-funded; reuse that check as a mandatory inventory-wide rollout preflight rather than claiming the comparator is absent. Legacy instances need their stored config.router inventoried before they expose v1 capability.Router/token cw2 remains 1.2.0 across different implementations, so version-only evidence cannot prove route funding. Trading-discovery cache identities omit the live token code ID.
execute_route_transferauthenticates the configured router and tests membership with.any(), without consuming a settlement entry. The canonical router emits each entry once: replay is a conditional trusted-router regression risk, not a demonstrated outsider drain. Its debit is the router's balance, not arbitrary trader wallets.Why a new implementation is needed
The current write-once trust model can halt existing taxed routes during router replacement and provides no standard recovery/revocation path; upgrade attestation must distinguish actual funded code.
Constraints and guardrails
Relevant files
Recommended direction
Acceptance criteria
Test plan: supported and failure paths
Test plan: attack, hack and abuse vectors
Verification criteria
Record revision, UTC time, exact commands, outcomes and evidence scope. Complete runnable checks first. Unavailable signing, deployment, device or infrastructure checks must be explicitly recorded as unverified; they do not block filing or implementation. An executed failure remains FAIL. Never claim deployment acceptance from unit tests or read-only probes. Public receipts must use synthetic identities and omit secrets.
Related work and duplicate check
Complements open #1384 rollout with missing source recovery and preflight behavior. #1229 is already open; do not duplicate it. Settlement replay is included as conditional authorization hardening, not an independently reproduced fund-loss exploit.
Related remediation reports
1390: launch-guards, 1394: discovery-cache. Each report owns its stated acceptance scope.
Merge sweep 2026-10-05: the two existing October 4 audit reports are being preserved on main with the sanity receipt. They document findings; committing them does not implement remediation.
Remaining implementation: Preserve or deliberately rotate trusted router identity across upgrades and revoke obsolete settlement permissions. The rollout now migrates existing addresses in place; the underlying trust-lifecycle remediation is not implemented by this merge. This issue stays open for that substantive work, not merely a verification hold.
PR #1408 and the final integration PR #1423 are merged into main. Source acceptance: 944 contract tests + strict all-target Clippy, 858 indexer tests across 29 suites, and 3,093 frontend tests + lint/build. Fresh pinned optimizer verification passed. Full receipt.
Settlement/refund fixture interfaces were reconciled, legacy zero nonces remain rejected, and the shared test signer aliases now use the funded account. The integrated contract and funded-route checks pass.
CI was skipped by explicit operator instruction. Native wrap-stack and production execution remain explicitly unverified. Deployment/history/release work is transferred to #1421 and existing #1384/#1385/#1386; the default query-gas repair is #1422. The source issue is complete and carries no verification-only hold; closure does not claim production deployment.