-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
chore(data-forwarding): Limit access with feature flag #102873
New issue
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Feature flag check before database query to prevent disclosure
Feature flag check happens after database query in convert_args(). The convert_args() method fetches the DataForwarder object from the database before the feature flag is checked in the put() and delete() methods. This allows users without the feature flag to probe whether specific data forwarder IDs exist in an organization by observing different HTTP status codes (404 for non-existent vs 403 for feature disabled). The feature flag check should be moved to convert_args() before the database query to prevent this information disclosure.
src/sentry/integrations/api/endpoints/data_forwarding_details.py#L67-L85
| "PUT": ApiPublishStatus.EXPERIMENTAL, | |
| "DELETE": ApiPublishStatus.EXPERIMENTAL, | |
| } | |
| permission_classes = (OrganizationDataForwardingDetailsPermission,) | |
| def convert_args( | |
| self, | |
| request: Request, | |
| organization_id_or_slug: int | str, | |
| data_forwarder_id: int, | |
| *args, | |
| **kwargs, | |
| ): | |
| args, kwargs = super().convert_args(request, organization_id_or_slug, *args, **kwargs) | |
| try: | |
| data_forwarder = DataForwarder.objects.get( | |
| id=data_forwarder_id, | |
| organization=kwargs["organization"], |
clever, thanks cursor |
Adds a feature flag to limit the access to the new endpoints. Also checking the existing flag for access to the create/update endpoints, but not for get/delete (so that users who downgrade can delete their configs if they wish)
Adds a feature flag to limit the access to the new endpoints. Also checking the existing flag for access to the create/update endpoints, but not for get/delete (so that users who downgrade can delete their configs if they wish)
Adds a feature flag to limit the access to the new endpoints. Also checking the existing flag for access to the create/update endpoints, but not for get/delete (so that users who downgrade can delete their configs if they wish)
Adds a feature flag to limit the access to the new endpoints.
Also checking the existing flag for access to the create/update endpoints, but not for get/delete (so that users who downgrade can delete their configs if they wish)