nbd icon indicating copy to clipboard operation
nbd copied to clipboard

Integer Overflow in nbd-client.c:421

Open chenaotian opened this issue 1 year ago • 0 comments

https://github.com/NetworkBlockDevice/nbd/blob/4697b68efc0781ef0dd7bdc92229d399091fde51/nbd-client.c#L409-L422

In line 421, the retval->datasize is type uint32_t data that from socket, which is unsafe data. And the second parameter of realloc is also type unsigned int, so sizeof ( struct reply) + retval-> datasize whill overflow if retval->datasize big enough. Although the vulnerability is in the client, if the server is controlled by attacker, there will be Integer Overflow.

chenaotian avatar Aug 14 '22 10:08 chenaotian