The vulnerability is a CSRF issue in the preview token creation endpoint, /actions/preview/create-token, which is handled by the actionCreateToken method in craft\controllers\PreviewController. The vulnerability existed because the endpoint accepted a previewToken parameter directly from a GET request without validating its origin or integrity. An attacker could pre-determine a token, embed it in a URL, and trick a logged-in administrator into clicking it. This would cause the application to create a valid preview session using the attacker's token.
The patch mitigates this by introducing a token hashing mechanism. The ElementsController::actionEdit method now generates a random token and a corresponding secure hash (hashedPreviewToken). This hashed token is passed to the frontend. The frontend JavaScript (ElementEditor.js) then sends this hashed token to the PreviewController::actionCreateToken method. The actionCreateToken method was modified to validate the incoming token using Craft::$app->getSecurity()->validateData(), which ensures the token was generated by the application and not by an attacker. The key vulnerable function is craft\controllers\PreviewController::actionCreateToken as it was the function that improperly trusted user-supplied input, leading to the information disclosure.