-
Notifications
You must be signed in to change notification settings - Fork 606
Closed
Labels
Description
Describe the bug
The following commands when used together could hang the keydb-server, making it unable to reply to any clients and increasingly consume memory.
To reproduce
hmset myhash a 1
hrandfield myhash -9223372036854775808
Expected behavior
An error should be returned instead of hanging. This could avoid DoS and server OOM.
Additional information
- This can be reproduced in the keydb 6.3.2 docker image .
- This is likely due to improper checks for the range. When issued these two commands, the memory consumption of keydb increases over time drastically and is likely to cause an OOM of the OS.
- A similar bug was also found in redis reported here: [BUG]
hrandfield
hangs the server redis/redis#11671, where redis also hangs. There is a long discussion about how to implement the fix, which can be found in its related PRs.
Thanks.