Description
This script is possibly vulnerable to Cross Site Scripting (XSS) attacks.
Due to the Content-type header of the response (JSON), exploitation of this vulnerability is not possible. The issue might be indirectly exploitable if a client-side script processes the response and embeds it into an HTML context.
Manual confirmation is required.
Cross site scripting (also referred to as XSS) is a vulnerability that allows an attacker to send malicious code (usually in the form of Javascript) to another user.
Because a browser cannot know if the script should be trusted or not, it will execute the script in the user context allowing the attacker to access any cookies or session tokens retained by the browser.
Remediation
Your script should filter metacharacters from user input.
References
Acunetix Cross Site Scripting Attack
VIDEO: How Cross-Site Scripting (XSS) Works
Related Vulnerabilities
WordPress Plugin Shortcode Ninja Cross-Site Scripting (1.4)
WordPress Plugin BuddyPress Cross-Site Scripting (2.2.2.1)
WordPress Plugin Newsletter Meenews 'idnews' Parameter Cross-Site Scripting (5.1.0)
WordPress Plugin UpdraftPlus WordPress Backup Cross-Site Scripting (1.9.63)
WordPress Plugin Online Hotel Booking System Pro Cross-Site Scripting (1.1)