Skip to content

DOM XSS in Theme Preview

High
ErisDS published GHSA-9fgx-q25h-jxrg Apr 29, 2021

Package

npm ghost (npm)

Affected versions

>=4.0.0 <4.3.3

Patched versions

4.3.3

Description

Impact

An unused endpoint added during the development of 4.0.0 has left sites vulnerable to untrusted users gaining access to Ghost Admin. Attackers can gain access by getting logged in users to click a link containing malicious code. Users do not need to enter credentials and may not know they've visited a malicious site.

Ghost(Pro) has already been patched. We can find no evidence that the issue was exploited on Ghost(Pro) prior to the patch being added.

Self-hosters are impacted if running Ghost a version between 4.0.0 and 4.3.2. Immediate action should be taken to secure your site - see patches & workarounds below.

Patches

Fixed in 4.3.3, all 4.x sites should upgrade as soon as possible.
As the endpoint is unused, the patch simply removes it.

Workarounds

  • Log out of Ghost Admin
  • Suspend any users who cannot log out
  • Block access to /ghost/preview

Example of how to block access in nginx:

location ~ /ghost/preview {
    rewrite ^(\/(.*\/)?ghost\/)(.*)$ $1 redirect;
}

This redirects the endpoint to /ghost/, which mimics the behaviour after the patch is applied.

References

For more information

If you have any questions or comments about this advisory:


Credits: Paul Gerste, SonarSource (https://www.sonarsource.com/)

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:H/A:N

CVE ID

CVE-2021-29484

Weaknesses

No CWEs