feat: Flag shared are considered valid

This commit is contained in:
2025-11-10 17:27:47 +01:00
parent 3e9940150d
commit 47b9a8a7f1

View File

@@ -1,8 +1,8 @@
from CTFd.models import db
from CTFd.plugins.flags import BaseFlag from CTFd.plugins.flags import BaseFlag
from CTFd.utils.user import get_current_user from CTFd.utils.user import get_current_user
from CTFd.models import db
from .models import CheaterTeams
from .models import CheaterTeams
def report_cheater(challenge_id: int, cheater_id: int, helper_id: int, flag_id: int): def report_cheater(challenge_id: int, cheater_id: int, helper_id: int, flag_id: int):
@@ -34,13 +34,12 @@ class PersonalFlag(BaseFlag):
# If the flag is correct, we need to check if the team is the one associated with the flag # If the flag is correct, we need to check if the team is the one associated with the flag
curr_user_id = get_current_user().id curr_user_id = get_current_user().id
if int(user_id) == int(curr_user_id): if int(user_id) != int(curr_user_id):
# User is correct # Caught a cheater!
return True report_cheater(
chal_key_obj.challenge_id, curr_user_id, user_id, chal_key_obj.id
)
# Caught a cheater! return True
report_cheater(
chal_key_obj.challenge_id, curr_user_id, user_id, chal_key_obj.id
)
return False return False