The vulnerability, GHSA-p5gm-92h4-6pv6, allows users with API access to see metadata of documents and images in private collections. The root cause is the lack of permission checks for collection-level privacy in the Documents and Images API endpoints. The analysis of the patch commit 052caa0fd4af2f247ff4047b3bb5ec02fc8b61b1 reveals that the fix involves overriding the get_queryset method in both DocumentsAPIViewSet and ImagesAPIViewSet. Previously, these viewsets inherited the get_queryset method from BaseAPIViewSet, which simply returned all objects of the model. The patch introduces a new implementation of get_queryset in both viewsets. This new implementation checks for CollectionViewRestriction and filters out any documents or images that belong to collections the current user does not have access to. Therefore, the vulnerable functions are the get_queryset methods of DocumentsAPIViewSet and ImagesAPIViewSet as they existed before the patch (i.e., the inherited, non-filtering version from BaseAPIViewSet). During exploitation, a call to the documents or images API endpoint would trigger these methods.