logo

Database

Config Files Anonymous Auth Enabled

Description

Detects when anonymous authentication is enabled in .NET configuration files, which allows unauthenticated users to access application resources. This creates a security risk by potentially exposing sensitive functionality without proper authentication controls.

Weakness:

056 - Anonymous connection

Category: Access Subversion

Detection Strategy

    Scans .NET web.config files for authentication configuration sections

    Reports a vulnerability when finding <anonymousAuthentication enabled="true"> within an <authentication> tag

    The vulnerability location is reported at the 'enabled="true"' attribute position

Vulnerable code example

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <security>
      <authentication>
        <anonymousAuthentication enabled="true" /> <!-- Security risk: Allows anonymous access to web resources without authentication -->
      </authentication>
    </security>...

✅ Secure code example

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <security>
      <authentication>
        <anonymousAuthentication enabled="false" /> <!-- Disable anonymous access to require proper authentication -->
        <windowsAuthentication enabled="true" /> <!-- Enable Windows authentication for secure user identification -->
      </authentication>...