In-app reader
OpenWISP IPAM is multi-tenant: every Subnet belongs to an organization, and API access is scoped to the organizations a user belongs to. The CSV export endpoint, ExportSubnetView, omits the organization-membership check that its import sibling performs, and loads the subnet by primary key with no organization filter. An authenticated user who is a member of one organization can therefore export a subnet belonging to another organization — its name, CIDR, organization slug and every IP address in it — by issuing an export request for that subnet's id.
ImportSubnetView.post() authorizes first, by calling assert_organization_permissions():
# openwisp_ipam/api/views.py (ImportSubnetView)
def post(self, request, *args, **kwargs):
self.assert_organization_permissions(request) #
file = request.FILES["csvfile"]
...
self.subnet_model().import_csv(file)
Discussion
Sign in to join the discussion.
Keep reading
Optional: create a free account to save items, track programs, and sync across web + app. Reading stays free.