logo

Database

Xml Basic Auth Method Used

Description

Detects the use of Basic Authentication method in XML configuration files. Basic Authentication sends credentials encoded in base64 which can be easily decoded if intercepted, making it insecure unless used with TLS/SSL encryption. This poses a risk of credential theft through network sniffing.

Weakness:

015 - Insecure authentication method - Basic

Category: Protocol Manipulation

Detection Strategy

    Scans XML configuration files for <auth-method> tags

    Checks if the content of auth-method tag contains the word 'basic' (case insensitive)

    Reports a vulnerability when Basic Authentication is configured, indicating potential transmission of credentials in an easily decodable format

Vulnerable code example

<?xml version="1.0" encoding="UTF-8"?>
<web-app>
    <login-config>
        <auth-method>BASIC</auth-method>  <!-- Vulnerable: BASIC auth exposes credentials in Base64 encoding -->
        <realm-name>MySecureRealm</realm-name>
    </login-config>
</web-app>

✅ Secure code example

<?xml version="1.0" encoding="UTF-8"?>
<web-app>
    <login-config>
        <auth-method>FORM</auth-method>  <!-- Secure: Form-based auth avoids exposing credentials in headers -->
        <form-login-config>
            <form-login-page>/login</form-login-page>
            <form-error-page>/login?error</form-error-page>
        </form-login-config>...