diff --git a/ydb/core/mon/async_http_mon.cpp b/ydb/core/mon/async_http_mon.cpp index 2eeef75f2c36..a936d26e71d9 100644 --- a/ydb/core/mon/async_http_mon.cpp +++ b/ydb/core/mon/async_http_mon.cpp @@ -374,13 +374,15 @@ class THttpMonLegacyActorRequest : public TActorBootstrappedAllowedSIDs) { - if (result.UserToken->IsExist(sid)) { - found = true; - break; + if (result.UserToken) { + for (const TString& sid : ActorMonPage->AllowedSIDs) { + if (result.UserToken->IsExist(sid)) { + found = true; + break; + } } } - if (found || ActorMonPage->AllowedSIDs.empty()) { + if (found || ActorMonPage->AllowedSIDs.empty() || !result.UserToken) { SendRequest(&result); } else { return ReplyForbiddenAndPassAway("SID is not allowed");