We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was just doing some experimenting with DRF and found a potential security issue (information leak).
The generated forms in the Browseable API for ForeignKey fields should limit the displayed choices to the related field's ViewSet.queryset.
ViewSet.queryset
Currently, If a ViewSet filters its queryset to prevent users from accessing objects they don't own like so:
MyViewSet(ViewSet): #... def get_queryset(self, queryset, *args, **kwargs): return queryset.filter(user=self.request.user)
the user will only be able to access those objects. However, the select list in the Browseable API form will display objects belonging to all users.
select
Ideally this would hook into permission_classes and filter_backends as well.
permission_classes
filter_backends
The text was updated successfully, but these errors were encountered:
We could do with some better way to limit / filter the queryset choices in relationships, agreed.
Not sure how we'd approach that yet.
Sorry, something went wrong.
Superseeded by this documentation ticket #1985.
No branches or pull requests
I was just doing some experimenting with DRF and found a potential security issue (information leak).
The generated forms in the Browseable API for ForeignKey fields should limit the displayed choices to the related field's
ViewSet.queryset
.Currently, If a ViewSet filters its queryset to prevent users from accessing objects they don't own like so:
the user will only be able to access those objects. However, the
select
list in the Browseable API form will display objects belonging to all users.Ideally this would hook into
permission_classes
andfilter_backends
as well.The text was updated successfully, but these errors were encountered: