Apache Shiro DefaultLdapRealm LDAP Injection Vulnerability
Severe, but no confirmed exploitation yet. Schedule remediation in your next patch cycle and apply mitigations if you're exposed.
An unauthenticated attacker, remotely over the network, with no user interaction, can tamper with data.
A remote attacker can inject LDAP special characters into the Distinguished Name (DN) construction in DefaultLdapRealm class. User-supplied username input is directly concatenated into the LDAP DN template without any escaping of RFC 2253 special characters. This allows an attacker to manipulate the DN structure used for LDAP bind authentication, potentially bypassing authentication or impersonating other users. This issue affects all Apache Shiro versions through 2.2.0, and 3.0.0-alpha-1 when using DefaultLdapRealm Upgrade to Apache Shiro 2.2.1 or 3.0.0-alpha-2 or later, which fixes the issue.
Inferred from the weakness type (CWE) and how the flaw is reached — the techniques an attacker would chain to exploit this. Real-world corroboration appears here as threat intel is folded in.
Generated by Wavense from the CVE record — an immediate mitigation and the permanent fix.
Implement strict input validation on all user-supplied usernames before they reach the DefaultLdapRealm for LDAP authentication. Configure web application firewalls (WAFs) to filter and block suspicious LDAP special characters in user input. Monitor LDAP authentication logs for unusual bind attempts, high volumes of failed logins, or unexpected DN structures.
The permanent resolution is to upgrade Apache Shiro to a patched version. Specifically, upgrade to Apache Shiro 2.2.1 or 3.0.0-alpha-2 or later. All versions through 2.2.0, and 3.0.0-alpha-1 are affected when utilizing the DefaultLdapRealm.
Attackers can exploit this flaw by injecting LDAP special characters into user-supplied usernames, manipulating the Distinguished Name (DN) during LDAP bind authentication. This allows them to bypass authentication mechanisms or impersonate legitimate users. Successful exploitation can lead to unauthorized access to sensitive systems and data, compromising confidentiality and integrity.
Other CVEs affecting shiro
Apache Shiro before 1.2.5, when a cipher key has not been configured for the "remember me" feature, allows remote attackers to execute arbitrary code or bypass intended access restrictions via an unspecified request parameter.
Default configurations of Apache Shiro have a session fixation vulnerability. This issue affects Apache Shiro from 1.0 to 2.1.0, and 3.0.0-alpha-1. Users are recommended to upgrade to version 2.1.1, or 3.0.0-alpha-2 or later, which fixes the issue. In the affected versions, when a session already exists, it is not invalidated upon successful login, nor is a new session being generated with a new ID.
Authentication Bypass by Alternate Name vulnerability in Apache Shiro. This issue affects Apache Shiro: before 2.0.7. Users are recommended to upgrade to version 2.0.7, which fixes the issue. The issue only effects static files. If static files are served from a case-insensitive filesystem, such as default macOS setup, static files may be accessed by varying the case of the filename in the request. If only lower-case (common default) filters are present in Shiro, they may be bypassed this way. Shiro 2.1.0 and later has a new parameters to remediate this issue shiro.ini: filterChainResolver.caseInsensitive = true application.properties: shiro.caseInsensitive=true Shiro 3.0.0 and later makes this the default in shiro.ini-based configurations. Shiro 3.0.1 and later makes this the default in all configurations, including programmatic and Spring / Spring Boot.
With valid login credentials, URL Redirection to Untrusted Site ('Open Redirect'), Server-Side Request Forgery (SSRF) vulnerability in Apache Shiro. This issue affects Apache Shiro from 2.0-alpha to 2.1.0, and 3.0.0-alpha-1, only when using shiro-jakarta-ee integration module. Users are recommended to upgrade to version 2.1.1, or 3.0.0-alpha-2 or later, which fixes the issue by encrypting the cookie. After successful login, Jakarta EE integration module uses shiroSavedRequest cookie to redirect to a particular web page after login. This cookie was not validated, and can be forged to send a HTTP GET request from the server itself to an arbitrary URL from the cookie.