The issue arises from the improper sanitization of the `nickname` variable before it is displayed on a page. When API functions are enabled, an attacker can exploit this by updating a user's nickname with an XSS payload, achieving stored XSS. This stored XSS is triggered when users view articles published by the injected user.