Repository navigation
Conversation
| EMBEDDED_SUPERSET=True, | ||
| ) | ||
| @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") | ||
| @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices_class_scope") |
There was a problem hiding this comment.
This change speeds these tests up significantly
| query_obj["orderby"] = [(metric, asc)] | ||
| self.get_query_context_factory().create( | ||
| datasource={"id": self.datasource.id, "type": self.datasource.type}, | ||
| form_data=self.form_data, |
There was a problem hiding this comment.
This fixes #25006, form data wasn't being passed through to raise_for_access
| }, | ||
| ) | ||
| } | ||
| ) |
eschutho
left a comment
There was a problem hiding this comment.
This lgtm. Not sure if @john-bodley or @Vitor-Avila wanted to look before we merge it.
| ) | ||
| session = db.session | ||
| session.add(dataset) | ||
| session.commit() |
There was a problem hiding this comment.
I suspect the commit is unnecessary. This would mean that lines 240 and 241 become.
db.session.rollback()
There was a problem hiding this comment.
Yeah I guess it's unnecessary for these and we could instead just run these tests within an uncommitted transaction. Do you feel that's preferable? Here I pretty much just copied the pattern from existing fixtures I saw which all committed their changes.
|
Thanks for working on this PR! 🙏 |
|
hello, how/when can we get this update in production? |
If you're running any of the versions tagged right above your comment, you should already have it :) |
|
Thanks @rusackas I just upgraded to the latest release, however all my embeded charts stopped working. I am getting this error: 400 Bad Request: The CSRF session token is missing. Any thoughts on this? |
|
Sorry, not sure what the cause of that would be. |
|
okay, I was able to resolve that but now I have a new problem, the error is: Guest user cannot modify chart payload. Do you know how I can downgrade superset from 3.1.1 to 3.1.0? |
|
@talk2morris that's being tracked here, you might want to ask on that thread if it's not already covered: #27177 (comment) |
This submission confirms that the Insecure Direct Object Reference (IDOR) vulnerability in guest token chart access has been resolved. - Verified that `tests/integration_tests/security/guest_token_security_tests.py` exists and contains `test_raise_for_access__chart_not_on_dashboard`. - Ran the test successfully, confirming that attempting to access a chart not associated with the authorized dashboard raises a `SupersetSecurityException`. - Identified PR apache#25081 as the one that enabled the secure logic for guest/embedded users. - Confirmed that PR apache#24789 introduced the underlying security logic (Dashboard aware RBAC). The vulnerability report is valid for older versions, but the issue is fixed in recent versions.
- Confirmed that the IDOR vulnerability allowing guest tokens to access charts from unauthorized dashboards is fixed. - The fix was introduced in PR apache#25081 and released in Apache Superset 3.0.0. - Verified by running existing integration tests in `tests/integration_tests/security/guest_token_security_tests.py` which explicitly check for this unauthorized access scenario and raise a `SupersetSecurityException`. - No code changes were needed as the fix is already present in the codebase.
Confirmed that the vulnerability is fixed and identified the specific versions and Pull Requests that addressed different aspects of the issue: - **Strict IDOR (Accessing unauthorized charts):** - **Fixed in Version:** 3.0.0 - **PR:** apache#25081 ("fix: Allow embedded guest user datasource access with dashboard context") - **Mechanism:** `raise_for_access` now validates that the chart belongs to the dashboard. - **Payload Tampering (Modifying metrics/columns):** - **Fixed in Version:** 4.0.0 - **PR:** apache#27484 ("fix: check if guest user modified query") - **Mechanism:** Introduced `query_context_modified` check. - **Information Disclosure (Schema Leaks):** - **Fixed in Version:** 5.0.0 - **PR:** apache#30858 ("fix(chart data): removing query from /chart/data payload when accessing as guest user") Verified by running existing integration tests in `tests/integration_tests/security/guest_token_security_tests.py` and temporarily adding a test case to simulate payload tampering, which successfully triggered a security exception.
- Confirmed strict IDOR fix (accessing unauthorized charts) was in 3.0.0 (PR apache#25081). - Confirmed payload tampering fix (modifying metrics) was in 4.0.0 (PR apache#27484). - Confirmed schema leak fix was in 5.0.0 (PR apache#30858). - Verified via integration tests.
This commit confirms the fix for the reported Guest Token IDOR vulnerability and payload tampering issues. Findings: - **Strict IDOR (Accessing unauthorized charts):** - **Fixed in Version:** 3.0.0 - **PR:** apache#25081 - **Verification:** Verified with standalone PoC `poc_idor.py`. Attempting to access a chart belonging to Dashboard B while authorized for Dashboard A raises a security exception. - **Payload Tampering (Modifying metrics/columns):** - **Fixed in Version:** 4.0.0 - **PR:** apache#27484 - **Verification:** Verified with standalone PoC `poc_idor.py`. Attempting to modify metrics for an authorized chart raises a security exception. - **Schema Leak:** - **Fixed in Version:** 5.0.0 - **PR:** apache#30858 Verification method: - Created and executed a standalone Proof-of-Concept script (`poc_idor.py`) that bootstraps the Superset app context, creates temporary dashboards/charts, issues a guest token, and attempts the exploits. Both exploits were blocked. - Ran existing integration tests in `tests/integration_tests/security/guest_token_security_tests.py`. No code changes required as fixes are already present.
BACKGROUND
Recently, #24789 changed the way that datasource access is granted, specifically in the case that a user should have access to a datasource because they have access to a dashboard. Before #24789, datasource access was only granted as a result of dashboard access when
DASHBOARD_RBACwas enabled, or when a guest user viewed an embedded dashboard whileEMBEDDED_SUPERSETwas enabled.The PR made this process more secure, but only enabled it for
DASHBOARD_RBAC, not embedded.This PR is a follow-up that enables this for embedded. Without this PR, charts on embedded dashboards cannot load because guest users have no way to get access to the datasources.
Fixes #25006
cc @john-bodley
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
GIFs below are of a simple host app which renders an embedded superset dashboard
Before:

After:

TESTING INSTRUCTIONS
ADDITIONAL INFORMATION