bytedance / bytedance/InfiniStore

a risk of memory exhaustion

Open
#199 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
437
Forks
44
PR merge metrics
No merged PRs in 30d

Description

"In infinistore.cpp, within the on_read function, I’ve reviewed the context but haven't found any validation for body_size. Is there a risk of memory exhaustion from specially crafted malicious packets? I haven't had enough time to audit the entire codebase."

// prepare for reading body
client->expected_bytes_ = client->header_.body_size;
client->bytes_read_ = 0;
client->tcp_recv_buffer_ =
(char *)realloc(client->tcp_recv_buffer_, client->expected_bytes_);
client->state_ = READ_BODY;
}

Contributor guide

Open the contributing guide

Research direction

Start in infinistore.cpp at the on_read function and trace how header_.body_size reaches expected_bytes_ and reallocates tcp_recv_buffer_. Check whether incoming body sizes are validated before allocation and identify the intended bound from the surrounding protocol code. Done means maliciously large body_size values cannot cause unbounded memory allocation, with coverage for the rejection or safe handling path.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.