The vulnerability lies in the remote cluster invitation process where the same token from the invitation was reused for the established connection. This allowed an attacker who intercepted the invitation details to potentially send unauthorized payloads. The core of the vulnerability is in the remotecluster.Service.AcceptInvitation function, which failed to generate a new, unique token upon accepting an invitation. The provided patch addresses this by introducing a versioning system for invitations. For new version 2 invitations, AcceptInvitation now generates a fresh token. The app.App.CreateRemoteClusterInvite function was updated to create these new version 2 invites, and remotecluster.Service.ReceiveInviteConfirmation was updated to handle the new refreshed token sent back in the confirmation, thus completing the secure token negotiation flow. An engineer seeing this CVE would need to ensure their Mattermost instance is patched to a version where this new token negotiation logic is present to prevent potential abuse of the remote cluster feature.