可能重複:
What are the best practices for avoid xss attacks in a PHP site如何防止在查詢字符串中放置<script>元素的XSS攻擊?
例如:
http://www.mid-day.com/searchresult.php?query=%3Cscript%3Ealert%28%22This%20is%20vulnerable%20for%20XSS%20..%20by%20binny%22%29%3C/script%3E
這個網站有一個XSS DOM基於漏洞,我想知道是什麼原因導致這個漏洞以及如何預防它?
更多可能的副本:http://stackoverflow.com/search?q=xss+php – Gordon 2011-02-05 09:10:08