The vulnerability, identified as GHSA-9m84-wc28-w895, is a Cross-Site Request Forgery (CSRF) weakness in Ghost's authentication flow. The root cause was the failure to bind one-time codes (OTCs), used for two-factor authentication (2FA), to the specific session in which they were generated. An attacker could phish a user for their OTC and then use that code in their own separate browser session to take over the victim's account.
The analysis of the patch commit ec065a774fa125953d2aa644a59cd8990329e0a0 reveals several key changes to fix this. The core of the fix is in ghost/core/core/server/services/auth/otp.js, where the verify function was modified to accept a context parameter. This context, which is a unique challenge string stored in the user's session, is now concatenated with the secret and user ID during token generation and verification. This ensures a token is only valid within the session it was created for.
Several functions in ghost/core/core/server/services/auth/session/session-service.js were consumers of this vulnerable logic. The verifyAuthCodeForUser function, which backs the /session/verify endpoint, was patched to enforce an origin check (cookieCsrfProtection) and to use the new session-bound verification logic. Similarly, createSessionForUser was refactored to prevent a session from being improperly verified using a token from another context. These functions are the primary runtime indicators that would appear during exploitation of this vulnerability.