.NET配置文件的10大安全漏洞

ASP.NET应用程序在生产环境中部署时,需要检查Web.Config文件是否存在以下10个不正确的配置,可能导致安全漏洞:

1Disabling custom errors

Vulnerable: Secure:

<configuration> <configuration>

<system.web> <system.web>

<custom mode=”Off”> <customErrors mode=”RemoteOnly”>

2Leaving tracing enabled

Vulnerable: Secure:

<configuration> <configuration>

<system.web> <system.web>

<trace enabled=”true” <trace enabled=”false”

localOnly=”false”> localOnly=”true”>

3Enabling debugging

Vulnerable: Secure:

<configuration> <configuration>

<system.web> <system.web>

<compilation debug=”true”> <compilation debug=”false”>

4Making cookies accessible through client-side script

Vulnerable: Secure:

<configuration> <configuration>

<system.web> <system.web>

<httpCookies <httpCookies

httpOnlyCookies=”false”> httpOnlyCookies=”true”>

5Enabling cookieless session state

Vulnerable: Secure:

<configuration> <configuration>

<system.web> <system.web>

<sessionState <sessionState

cookieless=”UseUri”> cookieless=”UseCookies”>

6Enabling cookieless authentication

Vulnerable: Secure:

<configuration> <configuration>

<system.web> <system.web>

<authentication mode=”Forms”> <authentication mode=”Forms”>

<forms cookieless=”UseUri”> <forms cookieless=”UseCookies”>

7Failing to require SSL for authentication cookies

Vulnerable: Secure:

<configuration> <configuration>

<system.web> <system.web>

<authentication mode=”Forms”> <authentication mode=”Forms”>

<forms requireSSL=”false”> <forms requireSSL=”true”>

8Using sliding expiration

Vulnerable: Secure:

<configuration> <configuration>

<system.web> <system.web>

<authentication mode=”Forms”> <authentication mode=”Forms”>

<forms slidingExpiration=”true”> <forms slidingExpiration=”false”>

9Using non-unique authentication cookies

Vulnerable: Secure:

<configuration> <configuration>

<system.web> <system.web>

<authentication mode=”Forms”> <authentication mode=”Forms”>

<forms name=”.ASPXAUTH”> <forms name=”{abcd1234…}”

10Using hard-coded credentials

Vulnerable: Secure:

<configuration> <configuration>

<system.web> <system.web>

<authentication mode=”Forms”> <authentication mode=”Forms”>

<forms> <forms>

<credentials> …

</credentials> </forms>

</forms>

参考:《Top 10 security vulnerabilities in .NET configuration files

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值