I am facing one issue. When one user is sending messages to another user, he can send JS code which raises the security issue of 'Cross-Site Scripting'(a security vulnerability). the user can steal confidential information like cookies etc.
i have checked the Moodle Tracker portal, and there are three tickets(MDL-61420, MDL-61359, MDL-62736), where this issue is fixed for Moodle versions 3.5 and 3.6. But I am using Moodle version 4.1 and this issue still exists. Does anyone have any idea how to tackle this issue?
I am sending the below js code in message:
<script src=data:,alert(document.domain)//;
This code should not execute in the browser and should sent as a string.
Thanks in advance.

Screenshots are attached.