Skip to content

Fix IDOR in Dashboard API charts/datasets endpoints - #9

Open
sha174n wants to merge 10 commits into
masterfrom
fix-dashboard-idor-vulnerability-1547433012889191103
Open

sha174n wants to merge 10 commits into
masterfrom
fix-dashboard-idor-vulnerability-1547433012889191103

Conversation

@sha174n

@sha174n sha174n commented Feb 27, 2026

Copy link
Copy Markdown
Owner

This PR fixes a security vulnerability where a low-privileged user could access unauthorized charts and datasets via the dashboard API.

Changes:

  • Modified superset/dashboards/api.py:
    • In get_charts, added filtering to check security_manager.can_access_datasource(chart.datasource) for each chart.
    • In get_datasets, re-implemented the logic to fetch datasets for slices, adding a check security_manager.can_access_datasource(datasource) before including the dataset in the response.

Verification:

  • Added tests/integration_tests/dashboards/security_tests.py which 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.
  • Verified that the new tests pass with the fix.

PR created automatically by Jules for task 1547433012889191103 started by @sha174n

…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>
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions github-actions Bot added the api label Feb 27, 2026
google-labs-jules Bot and others added 9 commits February 27, 2026 18:00
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant