惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
V
Vulnerabilities – Threatpost
TaoSecurity Blog
TaoSecurity Blog
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
G
GRAHAM CLULEY
S
Securelist
P
Palo Alto Networks Blog
MongoDB | Blog
MongoDB | Blog
A
Arctic Wolf
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
WordPress大学
WordPress大学
Project Zero
Project Zero
T
Threat Research - Cisco Blogs
L
Lohrmann on Cybersecurity
C
Cyber Attacks, Cyber Crime and Cyber Security
F
Fortinet All Blogs
博客园 - 叶小钗
B
Blog RSS Feed
C
Cisco Blogs
Google DeepMind News
Google DeepMind News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Apple Machine Learning Research
Apple Machine Learning Research
G
Google Developers Blog
K
Kaspersky official blog
D
Docker
Latest news
Latest news
Cisco Talos Blog
Cisco Talos Blog
T
Tor Project blog
Cyberwarzone
Cyberwarzone
Security Latest
Security Latest
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Spread Privacy
Spread Privacy
Microsoft Azure Blog
Microsoft Azure Blog
C
Check Point Blog
J
Java Code Geeks
Simon Willison's Weblog
Simon Willison's Weblog
T
Tenable Blog
Recent Announcements
Recent Announcements
T
Tailwind CSS Blog
H
Help Net Security
L
LINUX DO - 热门话题
T
The Exploit Database - CXSecurity.com
Jina AI
Jina AI
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
NISL@THU
NISL@THU
美团技术团队
腾讯CDC

博客园 - Seraph

共享源码 统计多个word文件中的总字数 聚类算法DBScan共享 惭愧啊,居然两年没有写Blog了。翻看从前的东西恍惚隔世 DNN WebMail Module 开发 —— 第一篇 SharpWebMail 调试篇 开始研究DNN了。发现自己落伍了很多 在 ASP.NET 中执行 URL 重写(zz) XML转义 C#中的多線程 ASP 字符串函数 C# escape sequence - Seraph C#字符串的使用笔记 关于一个算法,看看大家有没有好办法。 写了一个进制转换的小函数,javascript的 发现好久没有写随笔了。 都是一些小东西(1)一个InputBox 谁知道怎么对一个asp.net的project加注册 天子呼来不上船,自称臣是酒中仙——我的嗜酒情节 两篇文章都是翻译了一半就翻不下去了,E文水平有待提高啊 Scott Watermasysk承诺的文档到现在还没有Release,sigh
Request Validation - 防止脚本攻击
Seraph · 2005-07-08 · via 博客园 - Seraph

A new ASP.NET version 1.1 feature, request validation, prevents the server from accepting content containing un-encoded HTML. This feature is designed to help prevent some script-injection attacks whereby client script code or HTML can be unknowingly submitted to a server, stored, and then presented to other users. We still strongly recommend that you validate all input data and HTML encode it when appropriate.

Request Validation 是ASP.NET 1.1的新特征,它可以禁止服务器接受含有未编码的HTML的内容。这个特征可以有效地保护服务器免受注入式脚本攻击。强烈建议验证所有的输入数据和HTML编码。
For example, you create a Web page that requests a user’s e-mail address and then stores that e-mail address in a database. If the user enters <SCRIPT>alert(“hello from script”)</SCRIPT> instead of a valid e-mail address, when that data is presented, this script can be executed if the content was not properly encoded. The new request validation feature of ASP.NET 1.1 prevents this from happening.
例如,你需要创建一个获取和存储用户email的网页。如果用于写入<SCRIPT>alert(“hello from script”)</SCRIPT>这样子的话,就会出问题。(啥问题我就不说了,hoho)

嗯,1.1直接就把这些过虑了,呵呵。出错信息就是potentially dangerous Request.Form value was detected...

<%@ Page validateRequest="false"  %>

Caution: When request validation is disabled, content can be submitted to a page; it is the responsibility of the page developer to ensure that content is properly encoded or processed.

Disabling request validation for your application
To disable request validation for your application, you must modify or create a Web.config file for your application and set the validateRequest attribute of the <PAGES /> section to false:

<configuration>
  <system.web>
    <pages validateRequest="false" />
  </system.web>
</configuration>

这样可以关闭这个功能。

或者嘛,就是encoder好了