fix: Validate not existing entity join keys for preventing panic #5763
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
I run go-based feature serving server and my server is listen on both HTTP and gRPC. I mainly use gRPC server on production environment. But if some entity join key not exists in expected join keys from feast registry, Calling function that fetch online features from online-store(
GetOnlineFeatures), the gRPC server is on panic . The panic is critical for production. If someone know this issue, a attack like DDoS is possible.For example, suppose someone who knows about this vulnerability keeps sending requests to my Feast gRPC feature serving server, specifying an entity join key that does not exist in my Feast registry. Then, every time such a request occurs, the gRPC feature serving server will panic, and eventually, it won't be able to process any of the normal requests that the server is supposed to handle. In fact, as long as the entity join key simply doesn't exist in the Feast registry, the attack would succeed even if they blatantly specify a key like "my_name_is_hacker".
So, I add validation logic that check if input entity join key exists in expected entity join keys for preventing panic.
For reference, the HTTP server not panic without my added logic(this lines raise error in it). But if the HTTP server includes the validation logic, debug is easier for feast users.
I attached the stack trace when the panic occurs. the panic occurs in this line.
Which issue(s) this PR fixes:
Misc