Skip to main content
Vulnerability Database/CVE-2024-23725

CVE-2024-23725: Ghost CMS XSS Vulnerability in Post Excerpt

CVE-2024-23725 is a cross-site scripting vulnerability in Ghost CMS that allows attackers to inject malicious code through post excerpts. This article covers the technical details, affected versions, security impact, and remediation steps.

Published:

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

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-23725 Overview

CVE-2024-23725 is a stored Cross-Site Scripting (XSS) vulnerability in Ghost, the open-source Node.js publishing platform. Versions prior to 5.76.0 fail to sanitize post excerpts handled by excerpt.js, allowing an attacker to inject script payloads that render inside post summaries. When a reader or administrator views an affected page, the browser executes the injected script in the context of the Ghost site.

The issue is tracked under CWE-79 and was addressed in Ghost 5.76.0.

Critical Impact

An attacker with the ability to create or edit posts can inject JavaScript into post excerpts, enabling session theft, administrative action hijacking, and content tampering against any user who views the summary.

Affected Products

  • Ghost (Node.js publishing platform) versions prior to 5.76.0
  • Deployments exposing post summaries through themes or RSS endpoints that render excerpt.js output
  • Self-hosted and container-based Ghost installations below the fixed release

Discovery Timeline

Technical Details for CVE-2024-23725

Vulnerability Analysis

Ghost generates short summaries of posts using logic in excerpt.js. In versions earlier than 5.76.0, this routine does not strip or encode HTML and JavaScript constructs that originate from post content. When a crafted post is rendered, the excerpt is written into the DOM without contextual escaping, producing a stored XSS condition.

Exploitation requires an attacker who can author or edit a Ghost post. The payload persists with the post and executes whenever a visitor loads a page that renders the excerpt, including index pages, tag archives, and feed consumers that trust the HTML. Because the script runs on the Ghost origin, it can read session cookies that are not marked HttpOnly, perform authenticated requests to the Admin API, or deliver drive-by content to readers.

Root Cause

The root cause is improper neutralization of user-supplied input during web page generation. The excerpt handler treats post-sourced strings as safe HTML rather than untrusted input, omitting the output encoding required for a browser rendering context.

Attack Vector

The vulnerability is reachable over the network and requires user interaction, since a victim must load a page containing the malicious excerpt. The attack crosses a trust boundary: a lower-privileged content author can affect sessions belonging to administrators or anonymous readers that view the summary. See the upstream fix in Pull Request #17190 for the specific sanitization change applied in excerpt.js.

Detection Methods for CVE-2024-23725

Indicators of Compromise

  • Post records whose custom_excerpt or auto-generated excerpt fields contain HTML tags such as <script>, <img onerror=, <svg onload=, or javascript: URIs.
  • Unexpected outbound requests from reader browsers to attacker-controlled domains originating from Ghost-rendered pages.
  • Administrative API calls that occur immediately after an admin loads a post list or excerpt-heavy page.

Detection Strategies

  • Query the Ghost database for excerpts containing angle brackets or event handler attributes, prioritizing posts authored by lower-trust contributor accounts.
  • Deploy a Content Security Policy (CSP) in report-only mode and monitor script-src violations tied to inline execution on post listing pages.
  • Scan RSS and sitemap outputs for script fragments, since excerpts frequently propagate into these feeds.

Monitoring Recommendations

  • Alert on new or modified posts where the excerpt field length or character set changes significantly for authors who do not normally write HTML.
  • Correlate web server access logs with admin session activity to identify excerpt views followed by privileged API usage.
  • Track Ghost version strings exposed in HTTP headers and generator meta tags to confirm all instances run 5.76.0 or later.

How to Mitigate CVE-2024-23725

Immediate Actions Required

  • Upgrade Ghost to version 5.76.0 or later using the official release from Ghost Release v5.76.0.
  • Audit existing posts for malicious excerpt content and remove or rewrite any excerpts containing HTML or script constructs.
  • Rotate administrator session cookies and API keys if indicators suggest excerpts were viewed by privileged users.

Patch Information

The fix is included in Ghost 5.76.0. The upstream change in Pull Request #17190 adjusts excerpt.js to properly handle untrusted input so that script payloads cannot be rendered inside post summaries. Self-hosted operators should update their container images or npm dependencies and restart the Ghost service after upgrading.

Workarounds

  • Restrict post authoring to trusted staff accounts until the upgrade is applied, limiting who can inject excerpt content.
  • Deploy a strict Content Security Policy that disallows inline scripts on the public site and admin interface to blunt payload execution.
  • Place a Web Application Firewall (WAF) rule in front of Ghost that blocks requests containing <script, onerror=, or javascript: strings in excerpt-related fields.
bash
# Configuration example: upgrade a self-hosted Ghost instance to the patched release
ghost update --version 5.76.0
ghost doctor
ghost ls

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

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

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.