Looking for the vulnerability index of Invicti's legacy products?
JAAS authentication bypass - Vulnerability Database

JAAS authentication bypass

Description

Manual confirmation is required for this alert.

This vulnerability occurs when Java Authentication and Authorization Service (JAAS) security constraints are improperly configured in web applications. JAAS is Java's implementation of the Pluggable Authentication Module (PAM) framework, designed to manage authentication and authorization independently from application code.

A common misconfiguration involves defining security constraints for only specific HTTP methods (such as GET and POST) while leaving other methods (such as HEAD, PUT, or DELETE) unprotected. When security constraints specify individual HTTP methods, any methods not explicitly listed remain accessible without authentication, allowing attackers to bypass authentication controls entirely by using alternative HTTP methods to access protected resources.

Remediation

Remove all <code>&lt;http-method&gt;</code> elements from your <code>&lt;security-constraint&gt;</code> definitions in the web.xml deployment descriptor. When no HTTP methods are explicitly specified, the security constraint automatically applies to all HTTP methods, preventing bypass attacks.<br/><br/><strong>Vulnerable Configuration:</strong><pre>&lt;security-constraint&gt; &lt;web-resource-collection&gt; &lt;web-resource-name&gt;Admin area&lt;/web-resource-name&gt; &lt;url-pattern&gt;/admin/*&lt;/url-pattern&gt; &lt;http-method&gt;GET&lt;/http-method&gt; &lt;http-method&gt;POST&lt;/http-method&gt; &lt;/web-resource-collection&gt; &lt;auth-constraint&gt; &lt;role-name&gt;administrator&lt;/role-name&gt; &lt;/auth-constraint&gt; &lt;/security-constraint&gt;</pre><strong>Secure Configuration:</strong><pre>&lt;security-constraint&gt; &lt;web-resource-collection&gt; &lt;web-resource-name&gt;Admin area&lt;/web-resource-name&gt; &lt;url-pattern&gt;/admin/*&lt;/url-pattern&gt; &lt;!-- No http-method elements - applies to ALL methods --&gt; &lt;/web-resource-collection&gt; &lt;auth-constraint&gt; &lt;role-name&gt;administrator&lt;/role-name&gt; &lt;/auth-constraint&gt; &lt;/security-constraint&gt;</pre>After making this change, redeploy your application and verify that all HTTP methods (GET, POST, HEAD, PUT, DELETE, etc.) properly enforce authentication for protected resources.

Related Vulnerabilities