The vulnerability, CVE-2026-105651, describes a Stored XSS issue where Ghost could store non-image files as bookmark icons or thumbnails, allowing arbitrary HTML to be hosted on the site's domain. The provided patch commit (b41fe3f2c399cef058e6b487782a0b2263e86c03) directly addresses this by modifying ghost/core/core/server/services/oembed/oembed-service.js.
Upon analyzing the diff, it's clear that the OEmbedService.processImageFromUrl method is the core function responsible for fetching and storing external images. The patch introduces a new detectFileType helper function and integrates a critical validation step within processImageFromUrl. Specifically, an else block is added to check the actual file type of the imageBuffer using detectFileType and then verifies if the detected extension is included in the configured image upload allowlist (this.config.get('uploads').images.extensions). If the file type is not supported, a ValidationError is thrown.
In the vulnerable version, this validation was absent. The system would proceed to store the imageBuffer without confirming its actual content type, relying potentially on an attacker-controlled file extension from the URL. This allowed for the storage of malicious HTML files disguised as images, leading to the described XSS. Therefore, OEmbedService.processImageFromUrl is the precise function that lacked the necessary security controls and would be involved in the exploitation flow.