Summary
Stored cross-site scripting in the Vertex AI SDK evals visualization component allows arbitrary JavaScript execution inside Jupyter or Colab notebooks.
An unauthenticated attacker who can inject script escape sequences into model evaluation results or dataset JSON can cause code to run in a victim's browser whenever the visualization is viewed.
Affected context
This vulnerability arises when the Vertex AI SDK's _genai/_evals_visualization component renders evaluation results or dataset JSON directly into notebook frontends.
It is relevant in workflows where users visualize model outputs or datasets in Jupyter or Colab without strict output sanitization.
In such contexts, attacker-controlled evaluation data or JSON content can persist and later be rendered as active script, leading to stored XSS within the notebook environment.
Exploit preconditions
- Attack surface: Notebook-based visualization of Vertex AI evaluation results and datasets.
- Required access: Ability to inject or influence evaluation outputs or dataset JSON consumed by the visualization (e.g., via shared data sources, pipelines, or compromised inputs).
- Trigger point: A victim opens or refreshes a Jupyter or Colab notebook that uses the vulnerable visualization component on tainted data.
- Why exploitation is possible: The component fails to neutralize script-capable content before rendering, allowing HTML/JavaScript from stored data to execute in the browser context.
Why this happens
The underlying issue is improper neutralization of user-controlled data before integrating it into HTML-based notebook visualizations.
The _genai/_evals_visualization component treats evaluation results and dataset JSON as display-safe, embedding them without robust escaping or sanitization.
This behavior maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting), where untrusted data is rendered as part of a web interface and interpreted as executable script by the browser.
Potential impact
- Execution of arbitrary JavaScript in the victim's Jupyter or Colab browser session.
- Theft or manipulation of notebook data, including evaluation results and datasets.
- Unauthorized actions within the notebook UI, such as altering cells or triggering notebook operations via script-driven interactions.
- Session hijacking or exfiltration of sensitive tokens accessible to the browser context.
- Persistent corruption of visualization outputs, degrading trust in evaluation and data quality.
General mitigation guidance
Effective mitigation focuses on treating all evaluation outputs and dataset content as untrusted until appropriately sanitized.
Common defensive patterns include:
- Applying strict HTML encoding or contextual output escaping before rendering dynamic content in visualization components.
- Using robust, vetted sanitization libraries that remove or neutralize script tags, event handlers, and dangerous attributes.
- Separating raw data from presentation logic, ensuring that JSON is rendered via safe templating mechanisms rather than string concatenation.
- Restricting which data sources can feed into visualization workflows and avoiding the use of unvalidated external or shared datasets.
- Designing notebook visualizations to run with least privilege in the browser, minimizing access to sensitive tokens or APIs.
How teams detect issues like this
Detection commonly involves a mix of automated and manual review techniques:
- Static analysis rules targeting direct insertion of data into HTML or JavaScript without escaping, especially in visualization and templating code.
- Code review checklists that flag any rendering of evaluation results or JSON into notebook UIs where sanitization or encoding steps are unclear.
- Security-focused linters or template analyzers that identify unsafe patterns such as innerHTML assignment or string-based DOM construction using untrusted data.
- Policy enforcement in CI/CD pipelines requiring security review for components that generate HTML for notebooks or other web-based interfaces.
- Periodic penetration testing of notebook visualization workflows to validate that stored data cannot be turned into active script.

