/

CVE-2026-24778

Severity:

HIGH RISK

(8.8)

Cross-Site Scripting (XSS) in Ghost Portal Member Flows

CVE-2026-24778

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Account Takeover and Privilege Abuse via Stored XSS

Severity:

HIGH RISK

(8.8)

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 cross-site scripting (XSS) vulnerability in Ghost Portal allowed attackers to craft malicious links that executed JavaScript in the browser of an authenticated staff user or member.

When a victim followed such a link while logged in, the injected script could run with their permissions, potentially enabling account takeover and unauthorized actions in the Ghost admin or member context.

Affected context

This vulnerability affects Ghost sites using impacted versions of Ghost (5.43.0–5.12.04 and 6.0.0–6.14.0) in combination with vulnerable Ghost Portal versions (2.29.1–2.51.4 and 2.52.0–2.57.0).

It arises in flows where user-supplied data is reflected into the Portal UI without robust output encoding or sanitization, and where authenticated staff users or members can be induced to follow crafted links.

The issue is most relevant for deployments that rely on the Portal member/signup/login widgets and where users regularly interact with links received via email, social media, or embedded content.

Exploit preconditions

  • Attack surface: Web front-end, specifically the Ghost Portal member interface loaded in the browser.
  • Required access: Ability to deliver or publish crafted URLs or content that cause the vulnerable Portal component to render attacker-controlled data (e.g., via posts, emails, or external links).
  • Victim state: The target must be an authenticated staff user or member, logged into Ghost or with an active session, and must visit the malicious link in a browser that loads the vulnerable Portal script.
  • Trigger point: Navigation to the attacker-crafted URL or interaction with attacker-controlled content that initiates the vulnerable Portal view or flow.
  • Why exploitation is possible: Certain data paths in Portal treat user-controlled values as HTML or JavaScript context without proper contextual encoding, allowing injected script to execute under the victim's session.

Why this happens

The root cause is improper neutralization of user-controlled input within the Ghost Portal front-end, aligning with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).

Untrusted values that can be influenced by an attacker are rendered into dynamic page content without appropriate escaping for the output context (HTML, attribute, or JavaScript). When a victim browser loads a crafted link that drives this code path, the browser interprets the injected payload as active script instead of benign data.

At a design level, the issue stems from mixing data and presentation logic in the Portal UI without consistently applying output encoding and sanitization layers at all render points where attacker-controlled content may appear.

Potential impact

  • Execution of arbitrary JavaScript in the victim's browser with their authenticated Ghost session.
  • Account takeover of staff users or members by stealing session tokens or performing credential-change actions.
  • Unauthorized content management actions, such as publishing, editing, or deleting posts, depending on victim privileges.
  • Abuse of member data, including viewing or modifying subscriber information accessible to the compromised account.
  • Further phishing or social engineering campaigns leveraging trusted admin or site content.

General mitigation guidance

Effective mitigation focuses on eliminating the conditions that allow untrusted data to become executable in the browser:

  • Apply strict output encoding: Ensure all user-controlled values rendered by Portal are encoded according to their exact context (HTML body, attributes, URLs, JavaScript strings). Use well-maintained templating or UI frameworks that handle encoding by default.
  • Sanitize risky content: Where rich or HTML-like data must be supported, sanitize it server-side and/or client-side using allowlists of safe elements and attributes, removing scripts, event handlers, and dangerous URL schemes.
  • Separate data from code: Avoid constructing markup or script via string concatenation. Prefer component-based rendering or virtual DOM approaches that treat user input strictly as data.
  • Enforce strict URL and parameter handling: Validate and normalize parameters used in member or Portal flows. Reject or constrain unexpected values and disallow arbitrary HTML or script-capable constructs.
  • Use defense-in-depth controls: Enable security headers such as Content Security Policy (CSP) to reduce the impact of any residual XSS, and ensure cookies are marked HttpOnly and Secure where appropriate to limit theft via script.
  • Minimize privilege where possible: Design roles and member capabilities so that compromise of a single account has limited blast radius, especially for non-owner staff accounts.

How teams detect issues like this

Detecting and monitoring for this class of issue can be approached on multiple levels:

  • Static analysis and linting: Use SAST tools and linters configured with rules for XSS, focusing on direct DOM insertion, dangerouslySetInnerHTML-like APIs, innerHTML, string-based template rendering, and unsanitized interpolation into HTML or JavaScript contexts.
  • Component-level security review: During code review, flag any paths where user-controlled fields are passed to UI components that bypass default escaping or deliberately inject raw HTML.
  • Automated dynamic testing: Incorporate DAST scanners or browser-based testing frameworks that systematically inject XSS payload markers into parameters used by Portal flows and monitor rendered pages for evidence of script execution.
  • Security regression tests: Maintain automated tests for past XSS vulnerabilities to ensure fixes remain effective as templates or member flows evolve.
  • Runtime monitoring: Log and analyze unusual navigation patterns, suspicious query parameters, or repeated access to URLs containing characters commonly used in XSS payloads, while respecting privacy and legal constraints.

Sources

SourceLink
github.comgithub.com/TryGhost/Ghost/commit/da858e640e88e69c1773a7b7ecdc2008fa143849
github.comgithub.com/TryGhost/Ghost/security/advisories/GHSA-gv6q-2m97-882h

Frequently asked

questions

It is remotely exploitable. An attacker only needs a way to deliver a crafted link or content to an authenticated staff user or member and convince them to open it in a browser that loads the vulnerable Portal script.

The attacker does not need prior access to the Ghost installation itself. They need the ability to influence what links a victim might click (for example, via email, messaging, or posts), while the victim must already be authenticated to the Ghost site.

The safest pattern is to ensure that all user-controlled values flowing into Portal templates are contextually encoded by default, avoid raw HTML injection APIs, and centralize any necessary HTML sanitization on a strict allowlist. Regularly rebasing custom Portal builds on upstream versions that have addressed known XSS issues further reduces risk.

Adopt secure-by-default UI patterns and frameworks that handle encoding automatically, mandate security-focused code review for any changes that touch templating or member flows, and include XSS-focused automated tests and static analysis in the CI pipeline. Combining these practices with CSP and conservative privilege design helps prevent and contain future XSS defects.

Find out what's already
exploitable in your codebase.