博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
A potentially dangerous Request.Form value was ...
阅读量:6214 次
发布时间:2019-06-21

本文共 1462 字,大约阅读时间需要 4 分钟。

hot3.png

A potentially dangerous Request.Form value was detected from the client

 

针对这个问题,以前在.net Framework2.0里,只要修改

<pages validateRequest="false" /> 

就可以

 

但是现在在4.0里,需要修改

 

 

The request validation feature in ASP.NET provides a certain level of default protection against cross-site scripting (XSS) attacks. In previous versions of ASP.NET, request validation was enabled by default. However, it applied only to ASP.NET pages (.aspx files and their class files) and only when those pages were executing.

In ASP.NET 4, by default, request validation is enabled for all requests, because it is enabled before the BeginRequest phase of an HTTP request. As a result, request validation applies to requests for all ASP.NET resources, not just .aspx page requests. This includes requests such as Web service calls and custom HTTP handlers. Request validation is also active when custom HTTP modules are reading the contents of an HTTP request.

As a result, request validation errors might now occur for requests that previously did not trigger errors. To revert to the behavior of the ASP.NET 2.0 request validation feature, add the following setting in the Web.config file:

<httpRuntime requestValidationMode="2.0" />

However, we recommend that you analyze any request validation errors to determine whether existing handlers, modules, or other custom code accesses potentially unsafe HTTP inputs that could be XSS attack vectors.

 

这样才对

转载于:https://my.oschina.net/Yamazaki/blog/108049

你可能感兴趣的文章
关于PPP认证中的PAP和CHAP原理取证与相关疑问
查看>>
MAVEN指南-3、使用问题及思考汇总
查看>>
利用JNI进行对象操作
查看>>
Real-Rime Rendering (2) - 变换和矩阵(Transforms and Matrics)
查看>>
Hessian和Spring整合
查看>>
easyui 合并问题
查看>>
漏洞信息发布平台和网络安全
查看>>
UIKit框架(10)自定义modal过渡效果
查看>>
setXfermode之使图片圆角化
查看>>
JAVA根据IP地址获取详细的地域信息
查看>>
Tomcat安装部署和安全加固优化以及反向代理应用
查看>>
常用软件整理
查看>>
磁盘超过2T无法用fdisk分区的问题
查看>>
scala特点和java的异同点
查看>>
VirtualBox中三维软件的libgl错误解决
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
#内存管理的艺术# 之 Nginx slab的实现 --- 第四篇“基于块的内存释放”
查看>>
linux下select函数详解及实例
查看>>
关于IE浏览器缓存的处理
查看>>