Skip to content

Remove recursive functions from trie cursor (potential DoS vector) #401

@meyer9

Description

@meyer9

Describe the bug

Recursive functions can cause a crash if a contract writes a bunch of values, then 0s all of them out. These will be stored as 0s in the db, and when fetching a key after it hits the max stack size, will overflow the stack.

Simple solution is to use a loop.

Steps to reproduce

n/a

Node logs


Platform(s)

No response

Container Type

Docker

What version/commit are you on?

n/a

What database version are you on?

n/a

Which chain / network are you on?

Base Sepolia

What type of node are you running?

Archive (default)

What prune config do you use, if any?

n/a

If you've built Reth from source, provide the full command you used

No response

Code of Conduct

  • I agree to follow the Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-trieArea: Merkle Patricia TrieK-bugKind: 🐛W-historical-proofsWorkstream: historical-proofs

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions