Event ID 1309 Source: ASP.NET 4.0.30319.0: Event code: 3005 Event message: An unhandled exception occurred. How to solve it?

冉凡瑞 1,140 Reputation points
2025-03-11T09:19:15.65+00:00

工程师您好:

AD环境中每台mail服务器上都有warning告警事件id 1309。具体信息如下:

消息 : Event code: 3005 Event message: 发生了未经处理的异常。 Event time: 2025/2/28 7:12:52 Event time (UTC): 2025/2/27 23:12:52 Event ID: 2d12345aeaf1234c8be12d60a123456f Event sequence: 144 Event occurrence: 143 Event detail code: 0 Application information: Application domain: /LM/W3SVC/1/ROOT-3-133840548167840070 Trust level: Full Application Virtual Path: / Application Path: C:\inetpub\wwwroot\ Machine name: MAIL007 Process information: Process ID: 16240 Process name: w3wp.exe Account name: NT AUTHORITY\SYSTEM Exception information: Exception type: HttpException Exception message: 从客户端(:)中检测到有潜在危险的 Request.Path 值。 在 System.Web.HttpRequest.ValidateInputIfRequiredByConfig() 在 System.Web.HttpApplication.PipelineStepManager.ValidateHelper(HttpContext context) Request information: Request URL: http://168.11.11.7/DB4Web/www.microsoft.com:23/foo Request path: /DB4Web/www.microsoft.com:23/foo User host address: 111.1.111.111 User: Is authenticated: False Authentication Type: Thread account name: NT AUTHORITY\SYSTEM Thread information: Thread ID: 59 Thread account name: NT AUTHORITY\SYSTEM Is impersonating: False Stack trace: 在 System.Web.HttpRequest.ValidateInputIfRequiredByConfig() 在 System.Web.HttpApplication.PipelineStepManager.ValidateHelper(HttpContext context) Custom event details:

时间 : 2025-02-28 07:12:52

显示名称 : mail007

设备 : mail007

事件ID : 1309

严重性 : warning

类型 : Application

源 : ASP.NET 4.0.30319.0

日志类型 : Windows

请问:

1、这个警告是什么意思?什么原因导致的?

2、对此事件需要特别关注吗?还是这是正常现象?

3、如何消除或者避免1309的告警事件?

感谢您的答复!!!

谢谢

ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
396 questions
0 comments No comments
{count} votes

Accepted answer
  1. JasonPan - MSFT 6,696 Reputation points Microsoft External Staff
    2025-03-11T14:11:52.8966667+00:00

    Hi @冉凡瑞,

    根据您提供的日志,我们可以清楚的知道ASP.NET的安全机制检测到了请求路径(/DB4Web/www.microsoft.com:23/foo)中包含潜在危险字符(如 :)。

    默认配置会拦截此类请求以防止注入攻击,所以请确认下日志中提到的URL中的冒号,是否是符合预期的。如果是的话,那么我们可以调整配置以允许冒号可以使用,那样可以消除此告警。

    以下的配置不推荐,因为它的安全性没有那么高了,会增加注入的风险。
    请结合实际场景和需求,我们会提供合适的方案。

    <configuration>
      <system.web>
        <!-- 放宽路径危险字符检查 -->
        <httpRuntime requestPathInvalidCharacters="" />
      </system.web>
      <system.webServer>
        <security>
          <requestFiltering>
            <!-- 允许冒号在路径中 -->
            <fileExtensions allowUnlisted="true" />
            <requestLimits maxAllowedContentLength="4294967295" />
          </requestFiltering>
        </security>
      </system.webServer>
    </configuration>
    

    如果答案是正确的解决方案,请点击“接受答案”并投赞成票。如果您对此答案有其他问题,请点击“评论”。

    注意:如果您想接收此线程的相关电子邮件通知,请按照我们的 文档 中的步骤启用电子邮件通知。

    Best Regards

    Jason

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.