Skip to content

Commit bb3a8f7

Browse files
health-check lacks iterator validation vulnerability (ydb-platform#4327)
1 parent 75a1178 commit bb3a8f7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ydb/core/health_check/health_check.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1513,12 +1513,16 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
15131513
void FillVDiskStatus(const TString& vSlotId, Ydb::Monitoring::StorageVDiskStatus& storageVDiskStatus, TSelfCheckContext context) {
15141514
auto itVSlot = BSConfigVSlots.find(vSlotId);
15151515
const TEvInterconnect::TNodeInfo* nodeInfo = nullptr;
1516+
1517+
context.Location.mutable_storage()->mutable_pool()->mutable_group()->mutable_vdisk()->mutable_id()->Clear();
1518+
context.Location.mutable_storage()->mutable_pool()->mutable_group()->clear_id(); // you can see VDisks Group Id in vSlotId field
15161519
if (itVSlot != BSConfigVSlots.end()) {
15171520
TNodeId nodeId = itVSlot->second->vslotid().nodeid();
15181521
auto itNodeInfo = MergedNodeInfo.find(nodeId);
15191522
if (itNodeInfo != MergedNodeInfo.end()) {
15201523
nodeInfo = itNodeInfo->second;
15211524
}
1525+
context.Location.mutable_storage()->mutable_pool()->mutable_group()->mutable_vdisk()->add_id(GetVDiskId(*itVSlot->second));
15221526
context.Location.mutable_storage()->mutable_node()->set_id(nodeId);
15231527
} else {
15241528
context.Location.mutable_storage()->mutable_node()->clear_id();
@@ -1531,10 +1535,6 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
15311535
context.Location.mutable_storage()->mutable_node()->clear_port();
15321536
}
15331537

1534-
context.Location.mutable_storage()->mutable_pool()->mutable_group()->mutable_vdisk()->mutable_id()->Clear();
1535-
context.Location.mutable_storage()->mutable_pool()->mutable_group()->mutable_vdisk()->add_id(GetVDiskId(*itVSlot->second));
1536-
context.Location.mutable_storage()->mutable_pool()->mutable_group()->clear_id(); // you can see VDisks Group Id in vSlotId field
1537-
15381538
storageVDiskStatus.set_id(vSlotId);
15391539

15401540
if (itVSlot == BSConfigVSlots.end()) { // this report, in theory, can't happen because there was slot mention in bsc group info. this slot info have to exists in bsc too

0 commit comments

Comments
 (0)