The vulnerability is a missing authorization (CWE-862) in the OpenWISP Controller PKI REST API. The CrlDownloadView class (in openwisp_controller/pki/api/views.py) inherits ProtectedAPIMixin, which is intended to scope querysets to the organizations managed by the authenticated user. However, in the vulnerable version, the retrieve() method bypassed this scoping by directly calling get_object_or_404(Ca, pk=kwargs["pk"]) instead of self.get_object(). This meant the organization-scoped queryset (which was also set to Ca.objects.none() in the vulnerable version) was never applied, allowing a manager of organization A to enumerate CA integer IDs and download the CRL of a CA belonging to organization B.
The fix (commits 9e1869e and its backport 90ded78) changes the queryset to Ca.objects.all() and replaces the direct lookup with self.get_object(), which applies the FilterByOrganizationManaged scoping. The vulnerable function is CrlDownloadView.retrieve, which is the method that would appear in a runtime profile/stack trace when the endpoint GET /api/v1/controller/ca/<id>/crl is accessed. Since this is a Python/Django project, the profiler would show the class and method name as CrlDownloadView.retrieve.