Skip to content

Commit

Permalink
Anticheat: Safeguard length against unsafe access in WARDEN_CMSG_CHEA…
Browse files Browse the repository at this point in the history
…T_CHECKS_RESULT
  • Loading branch information
killerwife committed Jul 24, 2024
1 parent a364c15 commit 3fadd9f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/game/Anticheat/module/Warden/warden.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,14 @@ void Warden::HandlePacket(WorldPacket& recvData)
uint32 checksum;
recvData >> length >> checksum;

if (length > (recvData.size() - (recvData.rpos() + 1)))
{
recvData.rpos(recvData.wpos());
_anticheat->RecordCheatInternal(CheatType::CHEAT_TYPE_WARDEN, "Packet checksum length fail");
_session->KickPlayer();
return;
}

if (BuildChecksum(recvData.contents() + recvData.rpos(), length) != checksum)
{
recvData.rpos(recvData.wpos());
Expand Down

0 comments on commit 3fadd9f

Please sign in to comment.