/

CVE-2026-45348

Severity:

HIGH RISK

(8.7)

Stored XSS in pyLoad Modern WebUI Theme

CVE-2026-45348

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Arbitrary JavaScript Execution in User Browsers

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

A stored cross-site scripting (XSS) vulnerability in pyLoad's modern WebUI theme allows unescaped user-supplied URLs to be injected into HTML and executed as JavaScript in the operator's browser.

An attacker who can submit a package link can craft a malicious URL that breaks out of an HTML attribute and runs arbitrary script code whenever an operator opens the downloads view.

Affected context

The issue occurs in the packages.js template of pyLoad's modern WebUI theme, where package link URLs returned from the backend API are interpolated into a JavaScript-built HTML string and inserted into the DOM using $(div).html(html).

The vulnerability is relevant when:

  • The modern theme is enabled and used to render the downloads view.
  • Users are allowed to submit or influence package link URLs.
  • The browser loads the affected view, causing the unescaped URL value to be rendered as part of the page's HTML.

The absence of a restrictive Content Security Policy (CSP) for inline scripts or event handlers increases the exploitability of this pattern.

Exploit preconditions

  • Attack surface: Web-based, through the pyLoad WebUI downloads view.
  • Required access: Ability to submit or control a package link (e.g., authenticated or semi-trusted user "Alice" who can add download URLs).
  • Trigger point: An operator (or any user with access to the WebUI) navigates to the downloads view where the malicious package entry is rendered by packages.js.
  • Why exploitation is possible: The link URL from the API is directly interpolated into a single-quoted HTML attribute inside a template literal without HTML encoding or attribute escaping, and the resulting string is injected into the DOM via .html(). This lets an attacker break out of the attribute context and inject event handlers or inline JavaScript, which the browser executes because no restrictive CSP blocks it.

Why this happens

This vulnerability stems from treating untrusted data as safe HTML and inserting it into the DOM without encoding or escaping, a direct instance of CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting).

In the affected template, the package link URL from the backend is concatenated into an HTML fragment within JavaScript, embedded inside single quotes in an attribute. Since no HTML or attribute escaping occurs, an attacker-supplied single quote and event handler (for example, onerror, onclick) terminates the original attribute value and injects executable script.

The use of $(div).html(html) amplifies the issue by instructing the browser to interpret the string as raw HTML rather than as text, allowing any injected tags or attributes to become active content.

Potential impact

  • Execution of arbitrary JavaScript in the operator's browser when viewing the downloads page.
  • Theft or modification of session data accessible to the injected script (e.g., cookies, local storage, in-page tokens) subject to browser protections.
  • Manipulation of the WebUI, including spoofing UI elements, altering visible download entries, or tricking operators into unintended actions.
  • Use of the operator's browser as a pivot to perform authenticated actions against pyLoad or integrated services.
  • Persistent compromise of operators' browsing sessions as long as the malicious package entry remains in the system.

General mitigation guidance

Effective mitigation focuses on treating all user-influenced values as untrusted and ensuring they cannot be interpreted as executable content when rendered:

  • Apply context-appropriate output encoding for all user-supplied data before inserting into HTML, especially within attributes. For attribute contexts, ensure characters like quotes, angle brackets, and backticks are encoded.
  • Prefer safe DOM APIs that separate data from markup, such as setting element.textContent / $(element).text() or using attribute setters (element.setAttribute) instead of building HTML strings and passing them to .html() / innerHTML.
  • Adopt a templating system that auto-escapes variables by default and requires explicit opt-out for raw HTML insertion.
  • Introduce a restrictive Content Security Policy (CSP) that disallows inline event handlers and inline scripts, reducing the blast radius if encoding gaps occur.
  • Minimize the privileges of data providers: restrict who can submit package links, validate links server-side, and reject clearly malformed or script-like URLs where appropriate.

How teams detect issues like this

Organizations can detect this class of issue through a combination of code analysis and runtime checks:

  • Static analysis rules that flag:
  • Concatenation of untrusted variables into strings passed to .html(), innerHTML, or similar sink APIs.
  • Interpolation of backend/API values into HTML attributes without encoding helpers.
  • Secure coding guidelines and code review checklists requiring reviewers to:
  • Verify that all user-derived data in templates passes through encoding/escaping functions appropriate to the output context.
  • Question any use of raw HTML insertion methods in UI code and prefer safer DOM operations.
  • Automated scanning tools (SAST and DAST) configured to detect stored XSS patterns, including payload injection via persisted fields like URLs, titles, and descriptions.
  • CSP violation monitoring (when CSP is present) to identify attempts to execute inline script or event handlers, which can highlight residual XSS vectors.

Sources

SourceLink
github.comgithub.com/pyload/pyload/security/advisories/GHSA-fcjq-435v-jx94

Frequently asked

questions

Yes. If an attacker can remotely submit or influence package link URLs (for example, through a network-accessible interface), they can store a malicious payload that executes in the browser of any operator who later opens the downloads view.

The attacker needs the ability to add or control a package link entry in pyLoad. In many deployments this requires authenticated access or integration with another system that feeds URLs into pyLoad.

The most robust fix is to ensure that all user-controlled values are properly escaped or encoded for their specific HTML context and to avoid using .html() / innerHTML with untrusted data. Using high-level templating engines that auto-escape output and manipulating the DOM via safe APIs rather than raw HTML strings significantly reduces XSS risk.

Adopting a secure-by-default front-end architecture—automatic output encoding, strict CSP, limited use of raw HTML sinks, and explicit review of any exceptions—combined with static analysis and security-focused code review, helps prevent new XSS issues from being introduced.

Find out what's already
exploitable in your codebase.