pair/router: default-deny blacklist guard on factory query error (#456) #993
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!993
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "qa/456-blacklist-default-deny"
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
Addresses GitLab #456 (SEC-I03 F-02): pair and router blacklist guards no longer fail open when the factory
BlacklistCheckquery returns an error.Per maintainer feedback on #456, pre-1.5.0 factory backwards-compatibility is removed (not yet deployed on mainnet). Any factory
BlacklistCheckquery error now returnsContractError::BlacklistGuardUnavailable— an observable, fail-closed signal instead of silently disabling blacklist enforcement.Changes:
pair/src/blacklist_guard.rsandrouter/src/blacklist_guard.rs: error arm returnsBlacklistGuardUnavailabledirectly (no version gate, noOk(None)/Ok(())pass-through).dex_common::blacklist::blacklist_query_error_blocksand cw2 version probe (only ran on error path in !982; no longer needed).factory_blacklist_query_error_blocks_swapsimulates a stale factory pointer.security-model.md,contracts-security-audit.md(B1),AGENTS_BLACKLIST_DECISION.md.Acceptance checklist
blacklist_guard.rs(pair + router)cd smartcontracts && cargo test -p cl8y-dex-tests factory_blacklist_query_error_blocks_swapcd smartcontracts && cargo test -p cl8y-dex-tests blacklist_tests -- --test-threads=1→ 9/9docs/security-model.md,docs/contracts-security-audit.md,skills/AGENTS_BLACKLIST_DECISION.mdmake test-contractsfull workspacemake test-contracts→ 388/389 pass; 1 pre-existing unrelated failure (pair_coverage_tests::test_empty_pool_provide_rejects_asset_decimals_above_bootstrap_caponmain)Third-party verification
Security review — MR !993
Commit reviewed:
f5085087abc5c3ad374b11184723a6ad5577cca2Scope: Pair/router
blacklist_guard.rsdefault-deny on factoryBlacklistCheckquery errors; removal ofdex_common::blacklist::blacklist_query_error_blockscw2 version probe; integration testfactory_blacklist_query_error_blocks_swap; docs/skills updates for SEC-I03 F02 (#456).Outcome:
FINDINGS: 0medium+Summary: This diff closes SEC-I03 F-02 (silent fail-open when
BlacklistCheckerrors). Both guards now map any factory queryErrtoBlacklistGuardUnavailable, removing the pre-1.5.0 / unreadable-factory pass-through that could disable blacklist enforcement after a stale factory pointer.Attack-path review (no exploitable medium+ issues):
probe_factory_blacklist) and router (assert_router_swap_not_blacklisted).pair_info.factory/ routerFACTORYare set at deploy/migrate by factory governance, not user execute input.BlacklistCheckpayloadaddr_validated; token list is pair assets + validated CW20 sender; router tokens/pairs come from resolved swap ops.Tests run:
cargo test -p cl8y-dex-tests factory_blacklist_query_error_blocks_swap— pass.Prior security threads: none on this MR; nothing to re-report.
Inline findings: none (no medium+ issues).
mentioned in commit
11c4fb4788