Conversation
…ndpoints Filters the results of get_charts and get_datasets to ensure the user has access to the underlying datasources. This prevents unauthorized access to chart and dataset metadata via the dashboard API. Co-authored-by: sha174n <105581038+sha174n@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Filters the results of get_charts and get_datasets to ensure the user has access to the underlying datasources. This prevents unauthorized access to chart and dataset metadata via the dashboard API. Co-authored-by: sha174n <105581038+sha174n@users.noreply.github.com>
Filters the results of get_charts and get_datasets to ensure the user has access to the underlying datasources. This prevents unauthorized access to chart and dataset metadata via the dashboard API. Co-authored-by: sha174n <105581038+sha174n@users.noreply.github.com>
Filters the results of get_charts and get_datasets to ensure the user has access to the underlying datasources. This prevents unauthorized access to chart and dataset metadata via the dashboard API. Co-authored-by: sha174n <105581038+sha174n@users.noreply.github.com>
Filters the results of get_charts and get_datasets to ensure the user has access to the underlying datasources. This prevents unauthorized access to chart and dataset metadata via the dashboard API. Co-authored-by: sha174n <105581038+sha174n@users.noreply.github.com>
This change fixes an IDOR vulnerability where low-privileged users could access unauthorized chart and dataset metadata via the dashboard API. Changes: - Modified `get_charts` in `superset/dashboards/api.py` to filter charts based on datasource access permissions using `security_manager.can_access_datasource`. - Refactored `get_datasets` in `superset/dashboards/api.py` to iterate through dashboard slices and verify datasource access permissions before returning dataset metadata. - Added explicit check for `chart.datasource` to satisfy mypy and prevent runtime errors if a chart has no associated datasource. - Added integration test `tests/integration_tests/dashboards/security_tests.py` to reproduce the vulnerability and verify the fix. The fix ensures that even if a user can view a dashboard, they cannot enumerate or view metadata for charts/datasets they do not have underlying permission to access. Co-authored-by: sha174n <105581038+sha174n@users.noreply.github.com>
This change fixes an IDOR vulnerability where low-privileged users could access unauthorized chart and dataset metadata via the dashboard API.
Changes:
- Modified `get_charts` in `superset/dashboards/api.py` to filter charts based on datasource access permissions using `security_manager.can_access_datasource`.
- Refactored `get_datasets` in `superset/dashboards/api.py` to iterate through dashboard slices and verify datasource access permissions before returning dataset metadata.
- Implemented logic to allow implicit access for:
- Admins
- Dashboard owners
- Guest users (if configured)
- Users with Dashboard RBAC access (if feature enabled)
- This ensures backward compatibility for authorized users while closing the vulnerability for unauthorized users.
- Added integration test `tests/integration_tests/dashboards/security_tests.py` to reproduce the vulnerability and verify the fix.
The fix ensures that even if a user can view a dashboard, they cannot enumerate or view metadata for charts/datasets they do not have underlying permission to access, unless they have explicit dashboard-level access that grants such permissions (RBAC/Owner).
Co-authored-by: sha174n <105581038+sha174n@users.noreply.github.com>
This change fixes an IDOR vulnerability where low-privileged users could access unauthorized chart and dataset metadata via the dashboard API.
Changes:
- Modified `get_charts` in `superset/dashboards/api.py` to filter charts based on datasource access permissions using `security_manager.can_access_datasource`.
- Refactored `get_datasets` in `superset/dashboards/api.py` to iterate through dashboard slices and verify datasource access permissions before returning dataset metadata.
- Implemented logic to allow implicit access for:
- Admins
- Dashboard owners
- Guest users (if configured)
- Users with Dashboard RBAC access (if feature enabled)
- This ensures backward compatibility for authorized users while closing the vulnerability for unauthorized users.
- Added integration test `tests/integration_tests/dashboards/security_tests.py` to reproduce the vulnerability and verify the fix.
The fix ensures that even if a user can view a dashboard, they cannot enumerate or view metadata for charts/datasets they do not have underlying permission to access, unless they have explicit dashboard-level access that grants such permissions (RBAC/Owner).
Co-authored-by: sha174n <105581038+sha174n@users.noreply.github.com>
This change fixes an IDOR vulnerability where low-privileged users could access unauthorized chart and dataset metadata via the dashboard API.
Changes:
- Modified `get_charts` in `superset/dashboards/api.py` to filter charts based on datasource access permissions using `security_manager.can_access_datasource`.
- Refactored `get_datasets` in `superset/dashboards/api.py` to iterate through dashboard slices and verify datasource access permissions before returning dataset metadata.
- Implemented logic to allow implicit access for:
- Admins
- Dashboard owners
- Guest users (if configured)
- Users with Dashboard RBAC access (if feature enabled)
- This ensures backward compatibility for authorized users while closing the vulnerability for unauthorized users.
- Added integration test `tests/integration_tests/dashboards/security_tests.py` to reproduce the vulnerability and verify the fix.
- Fixed `mypy` type hint compatibility by explicitly casting boolean conditions.
The fix ensures that even if a user can view a dashboard, they cannot enumerate or view metadata for charts/datasets they do not have underlying permission to access, unless they have explicit dashboard-level access that grants such permissions (RBAC/Owner).
Co-authored-by: sha174n <105581038+sha174n@users.noreply.github.com>
…BAC validation
This commit fixes an IDOR vulnerability where low-privileged users could
access metadata about charts and datasets they were not explicitly granted
access to, by querying the `/api/v1/dashboard/{id}/charts` and
`/api/v1/dashboard/{id}/datasets` endpoints. The backend failed to
re-validate the underlying resources' permissions.
This is fixed by updating the endpoints to explicitly check the
datasource/chart permissions against the user's role if the user does
not inherently have dashboard-level access (i.e. is not an Admin,
Dashboard Owner, or has explicitly been granted RBAC/Guest Token
permissions on the dashboard).
Co-authored-by: sha174n <105581038+sha174n@users.noreply.github.com>
This PR fixes a security vulnerability where a low-privileged user could access unauthorized charts and datasets via the dashboard API.
Changes:
superset/dashboards/api.py:get_charts, added filtering to checksecurity_manager.can_access_datasource(chart.datasource)for each chart.get_datasets, re-implemented the logic to fetch datasets for slices, adding a checksecurity_manager.can_access_datasource(datasource)before including the dataset in the response.Verification:
tests/integration_tests/dashboards/security_tests.pywhich reproduces the issue by creating a user with access to only one of two datasets in a dashboard, and asserting that only the authorized chart/dataset is returned by the API.PR created automatically by Jules for task 1547433012889191103 started by @sha174n