The vulnerability description states that insufficient capability checks allowed users to access details of other users. The provided commit 64a4311266cbe9a9a942c836931bef224018b77d directly addresses this by adding a capability check (course_require_view_participants) within the get_enrolled_users_by_cmid function in course/externallib.php. The function's purpose is to retrieve enrolled users, which aligns with the vulnerability's impact. The test file course/tests/externallib_test.php confirms this by adding a test case that expects a required_capability_exception when the moodle/course:viewparticipants capability is missing, and then calls core_course_external::get_enrolled_users_by_cmid. This clearly indicates that core_course_external::get_enrolled_users_by_cmid was the function lacking the necessary authorization check, making it the vulnerable function.