The vulnerability exists due to a broken access control flaw in the /_api/user-collection/create-first-user API endpoint, which is handled by the Automad\Controllers\API\UserCollectionController::createFirstUser function. This endpoint was designed for the initial setup of the first administrator account but failed to disable itself after completion. As a result, an unauthenticated attacker could call this endpoint on a fully configured system. The function would proceed to load all user accounts via UserCollection. When preparing the response, it serializes these user objects. The Automad\Auth\User::__serialize method includes the passwordHash and totpSecret in the serialized data. This serialized data, containing sensitive credential information for all administrators, was then returned in the JSON response to the attacker. The patch mitigates this by adding a check at the beginning of createFirstUser to verify if any user accounts already exist. If they do, the function immediately terminates with a 403 Forbidden error, preventing the information disclosure.