Migrated from nfvelten/arbitus#123
Summary
scan_value and redact_value in src/middleware/payload_filter.rs recurse into nested JSON without any depth limit. A payload with 10,000+ levels of nesting will overflow the stack and crash the server.
Location
src/middleware/payload_filter.rs
Fix
Add a max_depth parameter (default 64). On limit: either reject the payload with a JSON-RPC error or treat it as a block decision. Convert to iterative traversal using an explicit stack for robustness.
Related
References
Migrated from nfvelten/arbitus#123
Summary
scan_valueandredact_valueinsrc/middleware/payload_filter.rsrecurse into nested JSON without any depth limit. A payload with 10,000+ levels of nesting will overflow the stack and crash the server.Location
src/middleware/payload_filter.rsFix
Add a
max_depthparameter (default 64). On limit: either reject the payload with a JSON-RPC error or treat it as a block decision. Convert to iterative traversal using an explicit stack for robustness.Related
References