Miggo Logo

CVE-2025-9862: Ghost vulnerable to Server Side Request Forgery (SSRF) via oEmbed Bookmark

N/A

CVSS Score

Basic Information

EPSS Score
0.15848%
Published
9/15/2025
Updated
9/15/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
ghostnpm>= 6.0.0, <= 6.0.86.0.9
ghostnpm>= 5.99.0, <= 5.130.35.130.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The analysis of the security advisory and the associated commits points to a Server-Side Request Forgery (SSRF) vulnerability within the oEmbed feature of Ghost, specifically when handling bookmarks. The vulnerability, identified as GHSA-f7qg-xj45-w956, allowed authenticated staff users to make the Ghost server issue requests to arbitrary internal services.

The root cause was located in the fetchImageBuffer method of the OEmbedService class. The initial investigation focused on the provided patch commits. Commit 01d64c7c0ffbf90cd036195c60ded6d08077d612 directly addresses the SSRF issue. The diff for ghost/core/core/server/services/oembed/OEmbedService.js clearly shows that the native fetch() call, which does not have any restrictions on the target URL, was replaced by this.externalRequest(). This new method, defined in ghost/core/core/server/lib/request-external.js, is a hardened version of a request client that includes checks to prevent requests to private or local IP addresses, thus mitigating the SSRF risk.

The exploitation scenario involves a staff user creating a bookmark of a malicious URL. When Ghost's backend attempts to generate a preview for this bookmark, it fetches the URL, parses its oEmbed metadata (like og:image), and then uses the vulnerable fetchImageBuffer function to download the specified image. By crafting the og:image URL to point to an internal resource (e.g., http://127.0.0.1:5555/secret-file), an attacker could trick the server into fetching and potentially exposing internal data. The added E2E test in the patch confirms this exact attack vector.

Therefore, the primary vulnerable function is OEmbedService.fetchImageBuffer, as it was the entry point for the unauthorized internal request.

Vulnerable functions

OEmbedService.fetchImageBuffer
ghost/core/core/server/services/oembed/OEmbedService.js
The `fetchImageBuffer` function in the `OEmbedService` class was vulnerable to Server-Side Request Forgery (SSRF). It directly fetched a URL provided in the `og:image` or `icon` metadata of a bookmarked page without proper validation. A malicious staff user could create a bookmark pointing to a page they control, which in turn would have metadata pointing to an internal IP address. When Ghost's backend processed the bookmark to generate a preview, it would make a request to the specified internal service, allowing the attacker to exfiltrate data or probe the internal network.

WAF Protection Rules

WAF Rule

### Imp**t * vuln*r**ility in **ost's o*m*** m****nism *llows st*** us*rs to *x*iltr*t* **t* *rom int*rn*l syst*ms vi* SSR*. ### Vuln*r**l* v*rsions T*is vuln*r**ility is pr*s*nt in **ost v*.**.* to v*.***.* to *n* **ost v*.*.* to v*.*.*. ### P*t

Reasoning

T** *n*lysis o* t** s**urity **visory *n* t** *sso*i*t** *ommits points to * S*rv*r-Si** R*qu*st *or**ry (SSR*) vuln*r**ility wit*in t** o*m*** ***tur* o* **ost, sp**i*i**lly w**n **n*lin* *ookm*rks. T** vuln*r**ility, i**nti*i** *s **S*-**q*-xj**-w*