Skip to content

bug: recursive scan_value/redact_value in payload filter can stack overflow on deeply nested JSON #95

Description

@nfvelten

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

  • PROPOSAL.md §4.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2Medium priority

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions