The vulnerability description clearly identifies Role::stopMembership() in src/Roles/Entity/Role.php as the source of the vulnerability, due to a missing check for the minimum number of administrators. By comparing the git tags for the vulnerable version (5.0.8) and the patched version (5.0.9), I was able to isolate the specific commit that fixed the issue. The commit 95bd356881044c451d2c963915f8e651497759b5 contains the message 'All members of adminitrator role could be removed #2022' and modifies the Role::stopMembership function. The patch adds a crucial check at the beginning of the function to verify if the role is an administrator role and if removing the user would leave the role empty. If so, it throws an exception, preventing the action. This directly confirms that Role::stopMembership was the vulnerable function, as it lacked this essential validation, allowing for a denial of service by locking out all administrators.