wandb OpenUI Unauthenticated Share Overwrite Vulnerability Leading to Stored Cross-Site Scripting
Vulnerability
A vulnerability exists in wandb OpenUI versions prior to 1.0, specifically in the HTMLAnnotator component. The issue arises in the create_share and get_share functions within backend/openui/server.py. These endpoints lack authentication and authorization checks, allowing unauthenticated users to create or overwrite shared components with arbitrary HTML, including scripts. The injected HTML is not sanitized and is rendered in an iframe with allow-same-origin permissions, enabling access to the session cookies of users who view the shared component. This flaw can be exploited remotely, leading to session hijacking and account takeover.
Impact
Exploitation of this vulnerability results in stored cross-site scripting, with the injected script executing in the context of the user viewing the shared component. This allows access to the user's session cookies, facilitating account takeover. Additionally, the vulnerability enables unauthorized overwriting of shared components, disrupting the integrity of the application's sharing functionality.
Reproduction
To reproduce this vulnerability, send a POST request to the /v1/share/{id} endpoint without authentication. Include a JSON payload that injects a script into the 'html' field. After the share is created, send the link to an authenticated user. When the user opens the link, the injected script will execute, accessing their cookies.
Vulnerability Rating
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.
