Skip to content

Commit

Permalink
stranthen security
Browse files Browse the repository at this point in the history
  • Loading branch information
nkonev committed Jan 16, 2025
1 parent c856904 commit 4c670b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chat/handlers/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ func (ch *ChatHandler) CheckAccess(c echo.Context) error {
// ... here we check that the message which we found by potentially crafted overrideMessageId / overrideChatId with malicious intent
// really contains this fileItemUuid
encodedFileItemUuid := utils.UrlEncode(fileItemUuid)
if strings.Contains(overrideMessage.Text, encodedFileItemUuid) {
if len(fileItemUuid) != 0 && strings.Contains(overrideMessage.Text, encodedFileItemUuid) {
return c.NoContent(http.StatusOK)
}
}
Expand Down

0 comments on commit 4c670b0

Please sign in to comment.