Oct 8, 2026·6 min read·24 visits
Ghost CMS is vulnerable to a Regular Expression Denial of Service (ReDoS) in its import and migration handlers. Authenticated administrators can cause high CPU utilization and freeze the Node.js event loop by importing directories named with pathological regular expressions or configuring complex migration domain wildcards.
An authenticated Regular Expression Denial of Service (ReDoS) vulnerability in TryGhost Ghost (CMS) versions 4.0.0 through 6.66.x. An attacker with administrator privileges can upload crafted content import archives containing pathological directory names or migration patterns, triggering exponential backtracking in the Node.js V8 engine.
TryGhost Ghost is an open-source content management system (CMS) built on Node.js and the single-threaded V8 JavaScript engine. This architectural design relies on a non-blocking event loop to handle concurrent operations. Any operation that blocks the CPU prevents the event loop from executing other queued tasks, rendering the entire server unresponsive to HTTP requests.
This vulnerability, designated as CVE-2026-105646, belongs to the Regular Expression Denial of Service (ReDoS) class (CWE-1333). It exposes two distinct attack surfaces within the Ghost ecosystem: the archive import mechanism used to migrate content, and the media inliner service used to parse external URLs inside post bodies. An authenticated attacker possessing the Administrator role can abuse these functions to trigger CPU starvation.
The primary entry point occurs during the validation and normalization of file paths within uploaded import ZIP files. Because the application processes these structures dynamically to map import paths, an administrator can supply directory names crafted to induce exponential backtracking. The secondary attack surface exists in the migration domain parsing process, where the application evaluates wildcard domain configurations against large bodies of text without safety boundaries.
The fundamental vulnerability resides in the dynamic, unescaped compilation of regular expression objects using user-controlled parameters. When an administrator imports a package containing structured contents, Ghost identifies the root folder of the ZIP archive. The extracted directory path is stored as baseDir or startDir and subsequently concatenated into a new RegExp('^' + baseDir + '/') instantiation.
In computer science, regular expression engines operating on Nondeterministic Finite Automata (NFA), like the V8 engine, may exhibit exponential time complexity under specific circumstances. If a regular expression contains nested or overlapping quantifiers, such as (a+)+ or (a|a)+, and is evaluated against a partially matching sequence that lacks the terminating character, the engine evaluates every possible grouping permutation. This behavior is called exponential backtracking.
In Vector A, when Ghost processes files, it compares every file path inside the ZIP against the compiled baseDir pattern. If baseDir contains characters like (a+)+b and the target files inside the archive do not match the expected trailing character (e.g., aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/), the engine attempts to evaluate all combinations of the nested loop. This execution blocks the main Node.js thread, preventing the execution of any other asynchronous handlers, networking callbacks, or database operations.
In Vector B, the external-media-inliner.js module performs string matching to find external resources belonging to specific domains. Because migrator systems use wildcard patterns (for example, https?://i[0-9]{1}.wp.com), these rules are compiled directly as regular expressions. Under heavy workloads or with long, complex post contents, evaluating these unconstrained patterns against large text bodies similarly triggers exponential backtracking, starving the server's CPU resources.
An examination of the vulnerable code path prior to the fix commit 88ae6d6d56f8a239cb38a8c89de02f034f50e2ce highlights the absence of string sanitization. In ghost/core/core/server/data/importer/handlers/image.js, the dynamic regular expression was created by raw string addition:
// Vulnerable Implementation
loadFile: function (files, baseDir) {
const store = adapterManager.getAdapter('storage:images');
const baseDirRegex = baseDir ? new RegExp('^' + baseDir + '/') : new RegExp('');
// ...
}To resolve Vector A, the developers integrated Lodash's utility function _.escapeRegExp. This function sanitizes the string by escaping special regular expression characters (^, $, \, ., *, +, ?, (, ), [, ], {, }, |), converting them into literal string characters. Consequently, pathological payloads such as (a+)+b are interpreted as literal matching characters rather than active execution groups.
// Patched Implementation
loadFile: function (files, baseDir) {
const store = adapterManager.getAdapter('storage:images');
const baseDirRegex = baseDir ? new RegExp('^' + _.escapeRegExp(baseDir) + '/') : new RegExp('');
// ...
}For Vector B, wildcards within migration configurations must remain active, which prevents the usage of _.escapeRegExp. To mitigate this, developers isolated the regular expression matching execution inside a node:vm sandbox environment using a configurable timeout parameter. This execution model allows the runtime to abort the CPU-bound calculation if it exceeds the maximum allotted threshold.
// Sandboxed Evaluation with Timeout
function matchAllWithTimeout(content, regex, timeout) {
if (!findMatchesScript) {
findMatchesScript = new vm.Script('Array.from(content.matchAll(regex), (match) => match[1])');
findMatchesContext = vm.createContext({});
}
findMatchesContext.content = content;
findMatchesContext.regex = regex;
try {
return Array.from(findMatchesScript.runInContext(findMatchesContext, { timeout }));
} finally {
findMatchesContext.content = undefined;
findMatchesContext.regex = undefined;
}
}Exploiting this vulnerability requires authenticated access to the Ghost Administration control panel with Administrator privileges. A regular author, editor, or subscriber account does not have authorization to access the server's database or content import endpoints. The attack leverages the import mechanism accessible under the "Labs" or "Settings" sections of the administrative user interface.
The first phase of the attack involves creating a directory name containing a nesting pattern. An attacker can create a folder named (a+)+b on their local filesystem. Within this directory, the attacker inserts files containing long sequences of the matching character followed by a non-matching character, such as aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac.jpg. The attacker then compresses the parent folder into a standard ZIP archive.
mkdir -p "(a+)+b"
touch "(a+)+b/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac.jpg"
zip -r payload.zip "(a+)+b"Once the malicious ZIP file is uploaded to the /ghost/api/admin/db/ endpoint, the server extracts the contents. The import engine resolves the root directory of the archive to determine the base directory prefix. When the import module matches the inner file structures against the dynamic pattern compiled from the directory name, the V8 engine enters a non-terminating evaluation loop, blocking all subsequent thread events.
The recommended remediation is to upgrade the Ghost installation to version 6.67.0 or later. This release completely implements regex sanitization for file import functions and sandboxes external media wildcard evaluations. The updates can be applied using the Ghost command-line interface.
ghost updateIf an immediate upgrade is not feasible, administrators should restrict administrative access to highly trusted staff and enforce Multi-Factor Authentication (MFA). Since the exploitation vector requires administrative capabilities, reducing the number of users with the Administrator role directly limits the threat surface. Audit existing users to ensure only authorized personnel have import capabilities.
Additionally, organizations can configure Web Application Firewall (WAF) rules to inspect multipart form data sent to the Ghost import API endpoints. Specifically, blocking incoming ZIP file uploads that contain special characters like +, (, ), or * within directory or path structures can prevent the payload from reaching the backend extraction handler.
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
Ghost TryGhost | >= 4.0.0, < 6.67.0 | 6.67.0 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-1333 |
| Attack Vector | Network (AV:N) |
| CVSS | 4.9 (Medium) |
| EPSS | 0.00327 |
| Impact | Denial of Service (DoS) |
| Exploit Status | PoC |
| KEV Status | Not Listed |
The product uses a regular expression that can take a long time to evaluate against specific inputs, leading to a Denial of Service.
NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.
CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.
CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.
CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.
A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.
CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.