Indexer hardening: rate limits, max_maker_fills, logging, body limits (#379) #903
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!903
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-379-indexer-hardening"
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
Remediation for #376 findings M-05, M-06, L-04, L-05, L-08, L-09 (#379):
tracing::warnwhen bothRATE_LIMIT_RPSandRATE_LIMIT_LCD_HEAVY_RPSare explicitly0(dev/QA unlimited mode).MAX_MAKER_FILLS_HARD_CAP = 100inindexer/src/constants.rs(on-chain parity); GET route solve and DB hybrid sim clamp viaclamp_max_maker_fills; cache buckets extended to 100.blacklist-checkmaps LCD failure tolcd_gateway_err→ 502 (not 500).RequestBodyLimitLayer(128 KiB) on LCD-heavy router (coversPOST /api/v1/route/solve).encodeURIComponenton all pair/trader path segments.Docs:
docs/indexer-invariants.md,docs/route-solver.md,skills/AGENTS_INDEXER_API_LCD_SECURITY.md.Acceptance checklist
cd indexer && cargo test dev_allows_both_rate_limits_zero --lib+ manual:RATE_LIMIT_RPS=0 RATE_LIMIT_LCD_HEAVY_RPS=0startup logmax_maker_fillsclamped to 100docs/route-solver.md§ cap note;cargo test clamp_max_maker_fills_bounds --libindexer/src/lcd/mod.rs;lcd_log_pathredactionblacklist-checkreturns 502 on LCD failurecargo test --test security blacklist_check_lcd_failure_returns_502 -- --test-threads=1cargo test --test security post_route_solve_oversized_body_returns_413 -- --test-threads=1cd frontend-dapp && vitest run src/services/indexer/__tests__/client.test.tsVerification checklist (third parties)
Manual abuse checks (optional, needs running indexer):
Constants grep (single source in indexer):
Note:
make test-indexer-integrationcurrently fails on a pre-existing lib testzero_reserve_mirror_returns_no_output(also fails onmain); targeted suites above pass.changed the description
changed the description
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Reviewed by Cursor Bugbot for commit
ca446a5c07. Configure here.Prod startup warns limits disabled
Low Severity
When both rate-limit env vars are explicitly
0, startup logs that all API rate governors are disabled even underRUN_MODE=prod, where those values are immediately replaced with the default global and LCD-heavy limits. Operators can misread logs as an unsecured deployment.Reviewed by Cursor Bugbot for commit
ca446a5c07. Configure here.added 1 commit
43e21b2b- fix(indexer): skip M-05 disabled warning in prod modeCompare with previous version
resolved all threads
changed the description
Security review — MR !903
Commit reviewed:
ca446a5c07761c8c0aa8d6dd5aadb91e40a10e97Scope: Indexer hardening (#379) —
clamp_max_maker_fills/MAX_MAKER_FILLS_HARD_CAP,RequestBodyLimitLayer(128 KiB) on LCD-heavy router, LCD WARN log redaction,blacklist-check→lcd_gateway_err(502), startup rate-limit warning, frontendencPath/encodeURIComponent.Method: Traced attacker-controlled inputs (
max_maker_fillsquery/body, POST body size, compliance wallet param, indexer client path segments) through handlers, LCD client, rate-limit layers, and client-visible error paths. Cross-checked againstindexer/tests/security.rsandskills/AGENTS_INDEXER_API_LCD_SECURITY.md.Outcome:
FINDINGS: 0medium+max_maker_fillsnow clamped viaclamp_max_maker_fillsbefore grid/LCD fanout; oversizedPOST /route/solverejected with 413; LCD-heavy routes retain separate governor + 30s timeout.blacklist-checkLCD failures map to sanitized 502 (lcd_gateway_err); client bodies remain generic; LCD WARN logs use redacted path prefixes (full detail at DEBUG).RUN_MODE=prodstill clampsRATE_LIMIT_*=0to defaults; startup warning is informational only (not an authz bypass).Inline threads: none (no medium+ findings).
Prior Bugbot note on misleading prod startup warning when limits are clamped remains low / operational — not reported as medium+.
block:securitylabel not applied.mentioned in commit
9f1d4cb27d