Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SearchV2 DOS protection #3172

Open
roman-khimov opened this issue Feb 24, 2025 · 4 comments
Open

SearchV2 DOS protection #3172

roman-khimov opened this issue Feb 24, 2025 · 4 comments
Labels
config Configuration format update or breaking change I3 Minimal impact neofs-storage Storage node application issues S3 Minimally significant security Affects security U3 Regular

Comments

@roman-khimov
Copy link
Member

Is your feature request related to a problem? Please describe.

I'm always frustrated when I realize that specifically crafted SearchV2 requests can make the node spend a lot of CPU cycles for nothing. Normal requests that want to quickly find something are no longer a problem, but some other can be.

Describe the solution you'd like

Add an iteration limit to the SearchV2 implementation. If we're making like 10K iterations with no results we're done, internal error is returned. The parameter is node-specific with this 10K default.

Describe alternatives you've considered

Time limits, but they're harder to check.

Additional context

#3058

@roman-khimov roman-khimov added config Configuration format update or breaking change I3 Minimal impact neofs-storage Storage node application issues S3 Minimally significant security Affects security U3 Regular labels Feb 24, 2025
@carpawell
Copy link
Member

What "iterations" means here?

@roman-khimov
Copy link
Member Author

Keys evaluated as per primary index.

@carpawell
Copy link
Member

So your suggestion does not allow to find (10K+1)th element ever?

@roman-khimov
Copy link
Member Author

SV2 works with 1000 items returned along with the continuation token normally and this will still work for regular uses since there is just 1000 iterations per request. But if you have 6M objects in a container you can create a query for non-existing object and I don't want to scan 6M (or whatever per-node share of it) of entries to answer that.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
config Configuration format update or breaking change I3 Minimal impact neofs-storage Storage node application issues S3 Minimally significant security Affects security U3 Regular
Projects
None yet
Development

No branches or pull requests

2 participants