Apache Shiro’s LDAP caching bug accepts any password after one login
The worst password in the world is the one that does not matter. For Apache Shiro deployments that enable authentication caching on an LDAP realm, that is the situation described by CVE-2026-129349: after a user logs in successfully once, later logins for that user succeed with any password. An attacker who knows a valid username does not need to guess, spray, or phish. They can type the username, type anything into the password field, and the framework will let them in.
The advisory, published on the oss-sec mailing list on November 14, 2026, gives the flaw a CVSS 4.0 score of 9.1, critical. It affects org.apache.shiro:shiro-core before 3.0.1. The finder is Joshua Rogers; Lenny Primak is credited as the remediation developer. The fix is in Shiro 3.0.1, which no longer installs AllowAllCredentialsMatcher by default.
The bug is not in LDAP. It is not a cryptographic failure. It is a configuration interaction inside Shiro, and that is what makes it worth understanding. The vulnerable setup combines three things that each look reasonable on their own: an LDAP realm, authentication caching turned on for performance, and a default credentials matcher that accepts everything.
The bug is a configuration interaction
Apache Shiro is a Java security framework that provides authentication, authorization, cryptography, and session management. It is common in Spring and Java web applications, often as a transitive dependency rather than a direct choice. DefaultLdapRealm is the realm that authenticates users against an LDAP directory. JndiLdapRealm is the older JNDI-based variant. Both can use authentication caching.
A normal LDAP login works like this: the application receives a username and password, binds to the directory as that user, and if the bind succeeds, treats the identity as authenticated. The bind is the proof. It is also relatively expensive: it opens a connection, sends credentials, and waits for the directory to respond. Authentication caching stores the successful AuthenticationInfo so that later requests can skip the bind. For a busy application with thousands of sessions, that can be a meaningful performance win.
The danger is what happens on the cache hit. Shiro retrieves the cached authentication information, skips the LDAP bind, and then asks the realm's credentials matcher to verify the submitted password. DefaultLdapRealm installs an AllowAllCredentialsMatcher by default. That matcher does exactly what its name says: it accepts any credentials. In a normal LDAP flow, that is not catastrophic, because the bind already proved the password. In a cached flow, the bind is gone, and the matcher is the only check left. It accepts everything.
The result is an authentication bypass for any username that has logged in successfully at least once. The attacker needs a valid username, not a valid password. If the account has administrative rights in the application, the attacker gets those rights. If it is a low-privilege account, the attacker gets a foothold and can look for privilege escalation. The advisory does not describe active exploitation, and it should not be read as evidence of a mass campaign. It is a latent vulnerability in a configuration that many enterprise applications use.
The CVSS 4.0 vector helps explain the severity and the limits. It is network-exploitable, low complexity, no privileges required, no user interaction, with high confidentiality and integrity impact and no availability impact. The AT:P component means the attack requires the target to be in a specific state: authentication caching must be enabled. That is why the score is 9.1 rather than 10.0. It is critical, but conditional.
Who is actually exposed
The advisory is precise: the issue affects all Apache Shiro versions through 3.0.0, but only when using DefaultLdapRealm or JndiLdapRealm with authenticationCachingEnabled set to true. Authentication caching is not the default. That single sentence will lead some teams to close the tab. That would be a mistake.
“Not the default” does not mean “rare.” LDAP-backed enterprise applications are exactly where authentication caching is tempting. Directory binds are slow, directories are shared, and login volume is high. A performance-minded team may have enabled caching years ago and forgotten about it. A custom realm may extend DefaultLdapRealm and inherit the behavior. An application may use Shiro indirectly through a framework or a vendor product, so the team does not even know it is there.
The blast radius depends on the accounts. A customer-facing application with self-service registration may have many valid usernames, including dormant accounts. An internal application may have usernames that follow a predictable pattern. A former employee’s account may still exist. The attacker does not need to know which account has admin rights; they can try the ones they know and see what the application exposes. If the application uses the same Shiro realm for both authentication and authorization, the compromised identity carries whatever roles the directory grants.
The vulnerability is also a reminder that authentication caching and authorization caching are different things. The advisory is about authentication caching. Authorization caching stores roles and permissions after they are resolved; it does not skip the password check. Teams that audit the wrong cache may conclude they are safe when they are not.
What attackers need, and what they get
The attacker needs three things: network access to the application, a valid username, and the knowledge that the application uses a vulnerable Shiro configuration. The first is usually easy. The second can be obtained from public sources, error messages, directory enumeration, or a previous breach. The third may require probing, but the reward is high: a successful login with an arbitrary password is a clean authentication bypass, not a noisy exploit.
Once inside, the attacker has the application’s view of the user. That may include personal data, business records, administrative functions, or API tokens. The attacker can also use the account to move laterally if the application trusts the identity for downstream services. The advisory’s high integrity impact reflects the ability to act as the user, not just read data.
There is an important limit: the bug does not create a valid username. An attacker cannot log in as a user who has never successfully authenticated. That means a freshly provisioned account, or an account that has never logged in, is not vulnerable in the same way. But in most organizations, the set of users who have logged in at least once is large.
Detection: versions, configuration, and custom realms
The first detection step is a dependency inventory. Search for org.apache.shiro:shiro-core versions below 3.0.1. Do not stop at direct dependencies; Shiro is often pulled in transitively. An SBOM or a dependency scanner is the right tool. If the application is a vendor product, ask the vendor for a statement. If the application is a fat JAR or a container image, inspect the packaged libraries, not just the build file.
The second step is configuration review. Search for authenticationCachingEnabled set to true, and for DefaultLdapRealm or JndiLdapRealm in configuration files, Spring beans, Guice modules, or code. Search for AllowAllCredentialsMatcher and for custom realms that extend the LDAP realm. A custom realm may set the matcher explicitly, or it may inherit the default. Check the effective configuration, not just the file you think is authoritative.
The third step is runtime verification. If you can safely test in a non-production environment, create a test user, log in once with the correct password, then attempt a second login with a wrong password. If the second login succeeds, the configuration is vulnerable. Do this only with authorization and only in an environment you control. A test that confirms the bug is also a test that demonstrates the risk to stakeholders.
The fourth step is log review. Look for successful authentications from unusual source IPs, impossible travel, logins outside normal hours, and repeated attempts against valid usernames followed by a success. The bug does not leave a distinctive error signature, so behavioral analysis matters. If an account has no recent activity and suddenly logs in from a new location, that is worth investigating.
The fix and the workarounds
The definitive fix is to upgrade to Apache Shiro 3.0.1 or later. The fix no longer installs AllowAllCredentialsMatcher by default, which removes the dangerous combination. As with any security upgrade, check the release notes for breaking changes, test the authentication flow, and verify that custom realms still behave as expected. A major-version upgrade can change APIs and defaults; do not assume a drop-in replacement.
If an immediate upgrade is not possible, there are two workarounds. The first is to disable authentication caching on the affected LDAP realm. That returns the realm to the default behavior, where every login performs an LDAP bind. The performance cost is real, but it is better than an authentication bypass. The second is to configure a credentials matcher that actually verifies the submitted credentials against the cached authentication information. SimpleCredentialsMatcher is the example in the advisory. The key is that the matcher must not accept arbitrary credentials.
Do not rely on network controls alone. Putting the application behind a VPN or an identity-aware proxy reduces exposure, but it does not fix the bug for users who can reach the application. Do not rely on “we use SSO” either. Shiro may still be in the authentication path for a legacy application, a service account, or an admin console. The only reliable fix is to remove the vulnerable combination.
A staging test is worth the effort. After upgrading, create a dedicated test user, log in once, and then attempt a login with a deliberately wrong password. The second login should fail. If it succeeds, the application is still using a permissive matcher or a cached authentication path that the upgrade did not cover. Repeat the test for every LDAP-backed realm, including the ones that are only used by internal tools. The test is cheap, and it turns a configuration assumption into evidence.
After upgrading or applying a workaround, rotate credentials for accounts that could have been targeted. If an attacker logged in as a user, the password was not needed, so a password rotation alone will not invalidate the session. Revoke active sessions, rotate API tokens, and review the account’s recent actions. If the application issues its own session cookies, invalidate them. If it delegates to a downstream service, check that service’s logs too.
The bigger lesson: permissive defaults and transitive dependencies
The Shiro bug is a case study in how security defaults interact with performance features. AllowAllCredentialsMatcher is not malicious. It exists for cases where the realm has already verified the identity by other means. Authentication caching is not malicious either; it is a sensible optimization. The problem is the composition. A permissive default plus a cache that skips the proof produces a bypass.
Frameworks should make the dangerous combination hard to configure. A safer design would refuse to cache authentication when the credentials matcher accepts everything, or require an explicit opt-in with a warning. Shiro 3.0.1 moves in that direction by removing the default. But the broader lesson applies to every framework: when a performance feature skips a security check, the fallback check must be strong.
The supply-chain angle is just as important. Shiro is a transitive dependency in many Java applications. Teams often do not know they ship it. An SBOM, dependency scanning, and a software composition analysis process are not compliance theater; they are how you find the library before an attacker does. The same is true for vendor products: ask for a software bill of materials and a vulnerability disclosure commitment.
Finally, the advisory is a reminder that “critical” does not mean “universal.” The score is 9.1 because the impact is severe when the configuration is present. The configuration is not the default. The right response is not panic; it is a targeted audit. Find the LDAP realms, check the cache setting, check the matcher, and upgrade. If you do not use LDAP, verify that claim against the dependency graph and the runtime configuration. The bug is specific, but the search is cheap.
The bottom line
CVE-2026-129349 is a narrow bug with a wide blast radius for the configurations it touches. The fix is a version bump; the work is finding every LDAP realm, cache setting, and custom matcher in the dependency graph. Treat the audit as a supply-chain exercise, not a one-line patch. If you cannot upgrade today, disable authentication caching and verify that a wrong password fails.
Sources
- Primary: oss-sec advisory for CVE-2026-129349
- Apache Shiro security reports: shiro.apache.org/security-reports.html
- Apache Shiro advisory: Critical security advisories: LDAP realm and cookie fixes
- CVE record: CVE-2026-129349
- Apache Shiro project: shiro.apache.org