{"id":"GHSA-9fgx-q25h-jxrg","summary":"DOM XSS in Theme Preview","details":"### Impact\nAn 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. \n\nGhost(Pro) has already been patched. We can find no evidence that the issue was exploited on Ghost(Pro) prior to the patch being added. \n\nSelf-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.\n\n### Patches\nFixed in 4.3.3, all 4.x sites should upgrade as soon as possible.\nAs the endpoint is unused, the patch simply removes it. \n\n### Workarounds\n- Log out of Ghost Admin\n- Suspend any users who cannot log out\n- Block access to `/ghost/preview`\n\nExample of how to block access in nginx:\n\n```\nlocation ~ /ghost/preview {\n    rewrite ^(\\/(.*\\/)?ghost\\/)(.*)$ $1 redirect;\n}\n```\n\nThis redirects the endpoint to `/ghost/`, which mimics the behaviour after the patch is applied.\n\n### References\n\n- [Forum Post](https://forum.ghost.org/t/critical-security-update-available-for-ghost-4-x/22290)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* email us at security@ghost.org\n\n\n---\nCredits: Paul Gerste, SonarSource (https://www.sonarsource.com/)","aliases":["BIT-ghost-2021-29484","CVE-2021-29484"],"modified":"2026-05-07T05:02:01.371629337Z","published":"2021-04-29T21:53:18Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2021-04-29T20:40:06Z","nvd_published_at":"2021-04-29T21:15:00Z","cwe_ids":["CWE-79"],"severity":"MODERATE"},"references":[{"type":"WEB","url":"https://github.com/TryGhost/Ghost/security/advisories/GHSA-9fgx-q25h-jxrg"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29484"},{"type":"WEB","url":"https://github.com/TryGhost/Ghost/commit/14b3431de12e674a0bd562e9230e2891b6903ae2"},{"type":"WEB","url":"https://blog.sonarsource.com/ghost-admin-takeover"},{"type":"WEB","url":"https://forum.ghost.org/t/critical-security-update-available-for-ghost-4-x/22290"},{"type":"PACKAGE","url":"https://github.com/TryGhost/Ghost"},{"type":"WEB","url":"https://security.netapp.com/advisory/ntap-20210618-0006"},{"type":"WEB","url":"https://www.npmjs.com/package/ghost"}],"affected":[{"package":{"name":"ghost","ecosystem":"npm","purl":"pkg:npm/ghost"},"ranges":[{"type":"SEMVER","events":[{"introduced":"4.0.0"},{"fixed":"4.3.3"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/04/GHSA-9fgx-q25h-jxrg/GHSA-9fgx-q25h-jxrg.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N"}]}