从php页面中删除xss漏洞

laawzig2  于 2021-06-21  发布在  Mysql
关注(0)|答案(0)|浏览(190)

我有一个公共搜索页面,public/user可以从中搜索存储在mysql数据库中的记录,然后单击该页面生成的链接,在details页面中打开所选记录的详细信息。但页面中显示xss漏洞:
http头输入referer设置为javascript:prompt(984663);
输入反映在tag href参数、form tag action参数或(i)frame src参数中。
我已经把htmlentities()放在目标页面的每个值之前,也放在引用目标页面的页面上?有没有什么好办法使这两个页面免受攻击?
我的页面的代码片段是一个参考者,如下所示:

<a target="_new" href="<?php echo(htmlentities(SG::getBaseUrl())); ?>/reports/<?php echo(intval($c['sno'])); ?>/caseFullDtlByCaseSno.php" title="Click here to view full details of this case">
            <?php echo(htmlentities($c['first_party']).' V/S '.htmlentities($c['second_party'])); ?>
            </a>

如何从我的页面中删除以下类型的xss漏洞?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题