This section includes everything that is outside of the source code but is still critical to the security of the product that is being created. Because the issues covered by this kingdom are not directly related to source code, we separated it from the rest of the kingdoms.
debuggable
attribute of the <application>
tag defines whether compiled binaries should include debugging information.None
disables the entire certification validation process, which exposes the application to Man-in-the-Middle attacks. This mode should never be used in production environments.debug
attribute of the <compilation>
tag defines whether compiled binaries should include debugging information.
...
<configuration>
<system.web>
<authentication>
<forms
timeout="60" />
</authentication>
</system.web>
</configuration>
...
ChainTrust
and provides the maximum level of assurance that the certificate is valid. By default all certificates are validated using ChainTrust
.PeerTrust
or PeerOrChainTrust
. These settings should not be used in production environments because they significantly reduce the level of security granted by certificates.cacheRolesInCookie
attribute of the configuration/system.web/authentication/forms
element in web.config
is set to true
, then the roles for each user are cached in a cookie. If this information is stored in plain text, anyone with access to machines used to interact with the application will have access to the information stored in the cookie. Worse yet, if attackers are allowed to arbitrarily modify the data stored in cookies, they can falsify information provided to the application and potentially alter its behavior to their advantage.mode
attribute of the <customErrors>
tag defines whether custom or default error pages are used.ViewState
, FormsAuth cookies
, and ScriptResource.axd
URLs and passes those values to the application for further processing. However, this functionality can be modified using the aspnet:UseLegacyEncryption
setting to disable the cryptographic signature verification before decrypting payloads. This may allow a malicious client to decrypt, forge, or otherwise tamper with encrypted data.aspnet:UseLegacyEncryption
is set to true
.
...
<appSettings>
<add key="aspnet:UseLegacyEncryption" value="true" />
</appSettings>
...
<credentials>
elements in the web.config
file for an ASP.NET application, which supports plain text, MD5 and SHA1 password formats.web.config
entry incorrectly stores its passwords in plain text.
<configuration>
<system.web>
<authentication>
<forms protection="All">
<credentials passwordFormat="Clear">
<user name="user1" password="my_password"/>
<user name="user2" password="my_password1"/>
</credentials>
</forms>
</authentication>
</system.web>
</configuration>
passwordFormat
attribute of the configuration/system.web/authentication/forms/credentials
element. The possible values for this attribute are:Clear
- indicates that the password is stored in plain text (least secure)MD5
- indicates that the password's MD5 hash is storedSHA1
- indicates that the password's SHA1 hash is stored (most secure)cacheRolesInCookie
attribute of the configuration/system.web/authentication/forms
element in web.config
is set to true
, then the roles for each user are cached in a cookie. If this information is stored in plain text, anyone with access to machines used to interact with the application will have access to the information stored in the cookie. Worse yet, if attackers are allowed to arbitrarily modify the data stored in cookies, they can falsify information provided to the application and potentially alter its behavior to their advantage.true
or UseUri
, the application does not use cookies regardless of whether the browser or device supports cookies. When the value of the attribute is set to either AutoDetect
or UseDeviceProfile
, the cookies are not used depending on the configuration of the requesting browser or device.Trace
attribute of the <page>
directive to true
or on the application level by adding a trace
element in the web.config
file and setting its enabled
attribute to true
.<credentials>
elements in the web.config
file for an ASP.NET application, which supports plain text, MD5 and SHA1 password formats.web.config
entry incorrectly stores its passwords in plain text.
<configuration>
<system.web>
<authentication>
<forms protection="All">
<credentials passwordFormat="Clear">
<user name="user1" password="my_password"/>
<user name="user2" password="my_password1"/>
</credentials>
</forms>
</authentication>
</system.web>
</configuration>
passwordFormat
attribute of the configuration/system.web/authentication/forms/credentials
element. The possible values for this attribute are:Clear
- indicates that the password is stored in plain text (least secure)MD5
- indicates that the password's MD5 hash is storedSHA1
- indicates that the password's SHA1 hash is stored (most secure)