我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

php中的xss攻击示例/类型[重复]

Possible Duplicate:
What are the best practices for avoiding xss attacks in a PHP site
Examples of XSS that I can use to test my page input?

What are examples/types of client side xss attacks in php and how can I prevent them?

  1. Plain text as HTML. When you forgot to escape plain text with htmlspecialchars. No prevention needed: just escape your variables when you use PHP in templates. Or use smarty/twig/etc.

  2. HTML as HTML: when you allow users to create HTML(fckeditor/tinymce/plain HTML/etc). Use HTML sanitizer.

  3. BB codes to HTML conversion. Do not use own regex-based parser, use only FSM-parsers.

近期文章

  • 加载表单提交结果在同一个div中
  • simplexml_load_file没有加载文件
  • 在dompdf中使文本变粗或变大
  • 通过jQuery确认2个密码字段
  • Symfony2相当于before_filter?
  • Jquery PHP没有响应函数
  • form_validation有什么问题?
  • php对象运算符 - >没有实例?
  • 计数+ / - 用于复选框单击并取消选中
  • 我应该在哪里存储自定义的PHP日志?
  • 查询错误,什么是资源ID#9?
  • 显示缩略图图像的代码
  • 将变量绑定到Kohana消息
  • 在PHP中使用前缀零编号
  • PHP Regex拆分SQL字段列表
  • 找不到imageMagick mogrify模块
  • 如何自动换行回音描述
  • 使用cURL和PHP操作对象
  • Jem的免费PHP邮件表单(语法错误)[关闭]
  • PHP post数组和curl提交

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华