/

CVE-2026-126945

Severity:

HIGH RISK

(8.7)

Stored XSS (CWE-79) in Zipline HighlightCode Component

CVE-2026-126945

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Browser-side JavaScript execution and actions performed through a victim's account

Severity:

HIGH RISK

(8.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Zipline has a stored cross-site scripting vulnerability in HighlightCode, which can render uploaded file content without escaping it before highlight.js finishes loading. An authenticated attacker who can upload a crafted text file may cause JavaScript to run in the browsers of people viewing it, potentially allowing actions such as changing account settings on their behalf.

Affected context

The issue occurs in Zipline's HighlightCode component when it displays text file content before highlight.js has finished loading. It affects deployments with the vulnerable rendering behavior; authenticated users who can upload files may be able to store content that executes when another user views it.

Exploit preconditions

  • Attack surface: The file upload and viewing functionality that uses HighlightCode
  • Required access: An authenticated account with permission to upload files
  • Trigger point: A victim views an uploaded text file while the vulnerable rendering path is used
  • Why exploitation is possible: File content is rendered without escaping before highlight.js finishes loading, allowing browser-interpretable content to execute

Why this happens

The component renders untrusted file content without reliably encoding it for the browser's HTML context. This is a stored cross-site scripting flaw mapped to CWE-79: Improper Neutralization of Input During Web Page Generation. The underlying insecure pattern is allowing uploaded content to reach an HTML-rendering path before it has been safely escaped or handled as text.

Potential impact

  • JavaScript may execute in the browser of a user viewing the uploaded file.
  • An attacker could make API requests using the victim's active session.
  • Account changes or other actions available to the victim may be performed on their behalf.
  • Sensitive information accessible to the victim in the application may be exposed.

General mitigation guidance

Defensive patterns focus on treating uploaded content as untrusted and preventing it from being interpreted as markup or script.

  • Render file contents as text using context-appropriate output encoding.
  • Use secure-by-default rendering APIs and avoid inserting untrusted content as raw HTML.
  • Ensure escaping is applied at the point where content enters the browser-rendered context, independent of syntax-highlighting behavior.
  • Restrict upload permissions to users who need them and apply least privilege to account actions and API capabilities.
  • Use browser security policies, such as a restrictive Content Security Policy, as an additional defense rather than a replacement for safe rendering.

How teams detect issues like this

  • Use static analysis to identify unsafe HTML insertion APIs and rendering paths that bypass contextual output encoding.
  • Review code handling uploaded files, especially asynchronous rendering flows that change behavior while a library loads.
  • Test that uploaded content is displayed as literal text and cannot become executable markup in supported browser states.
  • Apply code-review and CI policies that flag raw HTML rendering of user-controlled data; automated review tools may help identify these patterns.

Sources

SourceLink
github.comgithub.com/diced/zipline/security/advisories/GHSA-m649-gvwx-j6qv
vulncheck.comvulncheck.com/advisories/zipline-before-4.5.1-stored-xss-via-highlightcode-component

Frequently asked

questions

An authenticated user who has permission to upload files may be able to store content that executes when another user views it.

The attacker does not necessarily need the victim's credentials, but a victim must view the affected uploaded file. The resulting script may make requests using the victim's active session.

Treat uploaded content as text and apply context-appropriate output encoding before rendering it in the browser. Avoid raw HTML insertion for untrusted content.

Use secure-by-default rendering APIs, review asynchronous and client-side rendering paths, restrict upload permissions, and enforce checks for unsafe output handling in code review and CI.

Find out what's already
exploitable in your codebase.