Summary
Ghost's oEmbed preview feature may execute externally hosted scripts without sufficient sandboxing. If malicious oEmbed content is processed by a staff user, an attacker may run script in the context of that user's administrative session and potentially compromise administrative access.
Affected context
The issue may occur in Ghost deployments that enable or process the oEmbed preview feature and allow externally hosted oEmbed content to be rendered for staff users. Risk is higher when previewed content is not isolated from the administrative origin and when staff sessions provide meaningful management privileges.
Exploit preconditions
- Attack surface: The oEmbed preview functionality in the Ghost administrative interface
- Required access: The ability to submit, influence, or cause processing of malicious oEmbed content
- Trigger point: Rendering the crafted preview in a staff user's authenticated administrative session
- Why exploitation is possible: Externally hosted scripts are not sufficiently sandboxed before being executed in the administrative context
Why this happens
The vulnerability results from treating externally sourced oEmbed content as trusted active content during preview rendering. When script-capable content is inserted into a privileged administrative origin without adequate isolation, browser execution can occur within the staff user's session context. This behavior maps to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Potential impact
- An attacker may execute script in a staff user's administrative session
- Administrative actions could be performed without the user's intended consent
- Session-related information or sensitive page data could be exposed
- Content, settings, or other administrative resources could be modified
- Affected administrative access could be used for further compromise
General mitigation guidance
Mitigation generally focuses on treating external oEmbed data as untrusted and preventing it from executing in privileged browser contexts.
Common defensive patterns include:
- Rendering previews in a strongly isolated sandbox with script execution disabled where practical
- Applying strict allowlists for supported providers, schemes, and embedded resource types
- Sanitizing and contextually encoding untrusted content before insertion into administrative pages
- Enforcing restrictive Content Security Policy controls
- Limiting administrative session privileges and separating preview rendering from sensitive application origins
- Requiring explicit user interaction before displaying externally sourced previews
How teams detect issues like this
Organizations can look for this weakness through:
- Static analysis rules identifying unsanitized oEmbed or third-party content inserted into HTML or DOM sinks
- Code review checks for iframe, script, and preview rendering without effective sandbox or origin isolation
- Testing with benign script markers and browser security instrumentation in controlled environments
- Content security policy violation reporting and monitoring of unexpected administrative-origin requests
- Policy enforcement requiring approved embed providers and secure rendering patterns
Automated security review tools may help identify common cross-site scripting and unsafe embedding patterns during development.

