Walk me through the mechanics of a Cross-Site Scripting (XSS) attack and how you would remediate it in a modern web framework at Groww.