【发布时间】:2016-05-30 13:35:17
【问题描述】:
这是我的原生网址:
127.0.0.1//myweb/home.php?u=daniel
现在当我包含这种类型的 xss 时:
127.0.0.1//myweb/home.php/"><script>alert('hacked')</script>?u=daniel
现在好像被黑了,如何避免这种类型的XSS攻击?
添加
这里是其他代码:(我没有添加获取用户数据)
require_once 'core/init.php';
$currentUser = new User();
$report = null;
if(!$currentUser->isLoggedIn()) {
Redirect::to('index.php');
}
【问题讨论】:
-
您必须展示管理应用程序这一部分的 PHP 代码。
-
我在此页面上的代码,只有在用户登录时才会通过,否则它将重定向到
index.php,然后其他代码仅用于获取数据。可以吗?