factory: assert_pair_in_registry on limit-config admin fns (#455) #981
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!981
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "qa/455-factory-registry-guard"
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?
execute_set_pair_limit_batch_max and execute_set_pair_limit_clean_config
validated the pair address with addr_validate but skipped assert_pair_in_registry
— unlike every other single-pair admin fn (set_pair_fee, set_pair_hooks,
set_discount_registry, set_pair_paused, sweep_pair). That let governance dispatch
UpdateLimitOrderConfig / UpdateLimitCleanConfig to any valid-but-unregistered
address, breaking the uniform registry-guard pattern (SEC-I03 F01).
Add the registry check to both, immediately after addr_validate, matching
set_pair_fee. Also corrected a wrong doc comment on the batch-max fn (it was the
update_config blurb). No behaviour change for valid governance ops on registered
pairs.
Tests: 3 new (batch-max + clean-config reject unregistered, both accept a
registered pair); factory lib 5/0, full workspace 460/0.
assigned to @Brouie
restored source branch
qa/455-factory-registry-guardSecurity review — MR !981
Commit reviewed:
f481b2b4b0ab4565425043b240256ce404f1423eScope:
smartcontracts/contracts/factory/src/contract.rs— addassert_pair_in_registrytoexecute_set_pair_limit_batch_maxandexecute_set_pair_limit_clean_config; registry-guard unit tests (#455 / SEC-I03 F01).Outcome:
FINDINGS: 0medium+Summary: This MR closes a permission-boundary gap (factory governance could previously dispatch
UpdateLimitOrderConfig/UpdateLimitCleanConfigviaWasmMsg::Executeto anyaddr_validate-passing address, while every other single-pair admin wrapper already requiredPAIR_ADDR_REGISTERED). The fix mirrorsexecute_set_pair_fee:ensure_governance→addr_validate→assert_pair_in_registry→ submessage. Downstream pair handlers remain factory-sender-gated (info.sender == pair_info.factory); the registry guard prevents the factory acting as a confused deputy toward unregistered targets. No new injection, authz bypass, or caller-controlled sink was introduced in the diff.Inline threads: none (no medium+ findings).
Security review: no medium+ findings on this diff.
mentioned in issue #455
mentioned in commit
e242a3abd1