The vulnerability is a classic case of reverse tabnabbing. It exists in the 'Comments Management' section of FeehiCMS. The analysis of the provided information, including the GitHub issue and the source code, points to the CommentController as the central component for this functionality.
The root cause of the vulnerability is in how user-submitted content is rendered. Specifically, in the backend/views/comment/index.php file, the GridView widget is configured to display the content of a comment using 'format' => 'html'. This setting tells the Yii framework to output the content as raw HTML.
The exploit scenario is as follows:
- An attacker submits a comment containing a hyperlink with a
target="_blank" attribute. The update action in CommentController handles the submission and stores the malicious content in the database.
- A user with administrative privileges navigates to the comment management page, which triggers the
index action of the CommentController.
- The
index action renders the index.php view. The GridView in this view displays the list of comments.
- The attacker's comment content, including the malicious link, is rendered as HTML. Because the application does not add
rel="noopener noreferrer" to the link, it becomes vulnerable.
- When the administrator clicks the link, the new page can change the location of the original tab to a phishing page, potentially stealing the administrator's credentials.
The function backend\controllers\CommentController::actions is identified as the key vulnerable function because it defines and configures the index action that leads to the vulnerable rendering. While the vulnerability is technically in the view file, the actions method is the entry point in the application's code that orchestrates this vulnerable behavior.