pair/router: version-gate the blacklist-guard fail-open (#456) #982
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!982
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "qa/456-blacklist-failopen-gate"
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?
Both blacklist guards returned Ok(None)/Ok(()) on ANY factory BlacklistCheck
query error, to stay compatible with pre-1.5.0 factories. That silently disabled
all blacklist enforcement if the stored factory pointer ever errored on the
check (SEC-I03 F02).
New dex_common::blacklist::blacklist_query_error_blocks() reads the factory's
cw2 version from raw storage (contract_info) and decides:
anomalous -> BLOCK (new ContractError::BlacklistGuardUnavailable, an observable
signal instead of a silent pass)
legacy fail-open. Residual (orphaned/typo'd factory address -> no contract ->
fails open) is documented in the helper; near-theoretical on-chain since
contracts aren't deletable. Flip the None arm to block for a stricter posture.
The version probe runs only on the error path, so the normal flow pays no extra
gas.
Tests: 5 new unit tests on the decision fn (current/newer block, pre-1.5 + both
unreadable cases fail open); blacklist integration suite 10/0 unchanged (real
factory, happy path); full workspace 460/0.
assigned to @Brouie
Security review — MR !982
Commit reviewed:
7cc0afb51d5b06efa8466ac62edec1168304d783Scope: Version-gated fail-open for pair/router factory
BlacklistCheckquery errors (dex_common::blacklist::blacklist_query_error_blocks, pair/routerblacklist_guard.rs, newBlacklistGuardUnavailableerror variants, unit tests).Method: Diff review; traced attacker-controlled inputs (swap sender/trader, token/pair addresses in guard probes) through
probe_factory_blacklist/assert_router_swap_not_blacklistedinto factoryquery_blacklist_check; verified version probe (query_wasm_raw→contract_infocw2 JSON) is only reachable on the query-error path and is not user-writable cross-contract.Outcome:
FINDINGS: 0medium+Inline threads: None (no medium+ findings).
Notes (non-finding)
>= 1.5.0+BlacklistCheckerror now blocks (BlacklistGuardUnavailable) instead of silently disabling enforcement.contract_info) remains intentional legacy compatibility; pairfactoryis set at factory-driven instantiation, not swap-time user input, so no plausible unprivileged bypass path was identified on this diff.Security review: no medium+ findings on this diff.
mentioned in issue #456
mentioned in commit
4940a5fcaamentioned in merge request !993