TP-Link TD-W8951ND XSS and CSRF Vulnerabilities

Summary
This host is running TP-Link TD-W8951ND and is prone to cross site scripting and cross site request forgery vulnerabilities.
Impact
Successful exploitation will allow attacker to execute arbitrary script code in the browser of an unsuspecting user in the context of the affected site. Impact Level: Application
Solution
No solution or patch was made available for at least one year since disclosure of this vulnerability. Likely none will be provided anymore. General solution options are to upgrade to a newer release, disable respective features, remove the product or replace the product by another one.
Insight
Multiple flaws are due to, - Input passed to the 'Referer' header in HTTP request is not properly sanitised before being returned to the user. - Input passed to the 'wlanWEBFlag', 'AccessFlag', 'wlan_APenable' parameter in '/Forms/home_wlan_1' is not properly sanitised before being returned to the user. - Input passed to the 'PingIPAddr' parameter in '/Forms/tools_test_1' is not properly sanitised before being returned to the user.
Affected
TP-Link TD-W8951ND Firmware 4.0.0 Build 120607, Other versions may also be affected.
Detection
Send a crafted data via HTTP request and check whether it is able to read the cookie or not.
References