在ASP.NET webmethod中防止XML DoS攻击

时间:2011-11-01 11:30:47

标签: asp.net web-services c#-4.0 denial-of-service

我有一个以下的Web方法(ASP.NET,c#4.0):

[WebMethod]
public XmlDocument NewQuote(string username, string password, XmlDocument xml)
{
   // process request
}

我想知道如何防止XML DoS攻击(十亿笑,外部实体等),因为XmlDocument被接受为参数?我在哪里以及如何禁止DTD处理?在网络方法的主体中显然为时已晚。

谢谢!

1 个答案:

答案 0 :(得分:0)

假设用户只能上传x个文件或调用该服务x次。