The vulnerability stems from improper input validation in calendar web services. Moodle's external API functions in externallib.php typically handle web service operations. The description specifically mentions calendar event type validation, which aligns with core_calendar_external class methods. The function submit_create_update_form is the primary entry point for event creation/updates via web services and would be responsible for validating event types. The CWE-20 classification confirms this is an input validation issue in the event type handling flow. While exact code isn't available, the pattern matches Moodle's architecture where form submission handlers in externallib.php validate user inputs for web services.