The vulnerability exists in the weblate.api.views.MemoryViewSet class, which is responsible for handling API requests related to the translation memory. The root cause of the vulnerability is that this class inherited from rest_framework.viewsets.ModelViewSet. In Django REST Framework, ModelViewSet automatically provides a full set of read-write actions: list, create, retrieve, update, partial_update, and destroy. The vulnerability advisory states that the translation memory API exposed unintended endpoints, and the commit message confirms that "Editing or creating entries was not supposed to be available here."
The patch, found in commit 55625f2c28bc8d1f4a86af8e374c3c16d84d2c63, addresses this issue by changing the base class of MemoryViewSet from ModelViewSet to ReadOnlyModelViewSet. The ReadOnlyModelViewSet only provides list and retrieve actions, effectively removing the vulnerable create, update, partial_update, and destroy endpoints and restricting the API to read-only access as intended. An attacker could have exploited this by sending crafted HTTP requests (POST, PUT, PATCH, DELETE) to the /api/memory/ endpoint to create, modify, or delete translation memory entries without proper authorization.