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!983
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "qa/451-458-indexer-config-guards"
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?
Two SEC-I config findings, both in config.rs:
#451 (SEC-I02 H14): FACTORY_ADDRESS was only rejected empty under RUN_MODE=prod.
An empty factory address makes verify_factory_provenance skip the provenance
check (pair_discovery.rs), so a staging/QA indexer with FACTORY_ADDRESS="" would
silently index unverified (possibly spoofed clone) pairs. Now rejected empty in
EVERY run mode (new ConfigError::EmptyFactoryAddress), before the prod block.
#458 (SEC-I04 F01): RATE_LIMIT_RPS=0 + RATE_LIMIT_LCD_HEAVY_RPS=0 disabled all
governors with only a warn!. On a non-loopback bind that's an unthrottled public
API. Now refuses to start when both are zero on a non-loopback API_BIND in
non-prod (new ConfigError::ZeroRateLimitNonLoopbackBind), with an explicit
ALLOW_ZERO_RATE_LIMITS=1 opt-out for offline/benchmark runs. Prod already clamps
both to 60/10 so the guard never fires there; loopback (Playwright/local-dev)
binds keep working. bind_is_loopback() treats 127/8, ::1, and "localhost" as
loopback and errs toward safety on anything else.
Tests: 4 new config tests (empty-factory reject, dual-zero non-loopback reject,
opt-out allow, loopback allow, prod-clamp loads); indexer lib 167/0.
assigned to @Brouie
Security review — MR !983
Commit reviewed:
6ae404135a3564e236c74c79a24fe4018fbc904fScope:
indexer/src/config.rs— startup guards for emptyFACTORY_ADDRESS(allRUN_MODEs) and dual-zero rate limits on non-loopbackAPI_BINDin non-prod (ALLOW_ZERO_RATE_LIMITSopt-out).Outcome:
FINDINGS: 0medium+Summary: This MR closes two configuration footguns (#451 / SEC-I02 H14, #458 / SEC-I04 F01) rather than introducing new attack surface. Traced both guards against downstream sinks:
Empty factory —
Config::from_env()now rejects whitespace-onlyFACTORY_ADDRESSbefore mode-specific checks, so production/staging cannot reachverify_factory_provenance's empty-factory skip path (pair_discovery.rs). Attacker-controlled chain input cannot bypass this; it is enforced at process startup from operator env.Dual-zero rate limits — Non-prod startup fails when both
RATE_LIMIT_RPSandRATE_LIMIT_LCD_HEAVY_RPSparse to0,API_BINDis non-loopback, andALLOW_ZERO_RATE_LIMITSis unset.bind_is_loopback()errs toward safety (unparsed hostnames are not treated as loopback). Prod remains protected by existing zero-to-clamp logic (60/10). The opt-out requires deploy-time env control, not a remote caller primitive.Not reported (out of scope / pre-existing): single-zero rate limit on a public bind in dev (one governor disabled while the other remains), direct
Config { ... }construction in integration tests, or governance/operator misconfiguration withALLOW_ZERO_RATE_LIMITS=1.Inline threads: none (no medium+ findings).
Security review: no medium+ findings on this diff.
mentioned in issue #451
mentioned in issue #458
mentioned in commit
d326a2e188mentioned in merge request !992
mentioned in merge request !996