79% vs 51%: independent neobanks lag on app security. Read the report

Deep Dive

Deep Dive

Apache Shiro LDAP Auth Bypass, Fixed in 3.0.1 (CVE-2026-129349)

Apache Shiro before 3.0.1 accepts any password for a cached LDAP user when authentication caching is enabled; fixed in 3.0.1.

TL;DR

  • Apache Shiro before 3.0.1 accepts any password for an LDAP user whose authentication is cached, when authentication caching is enabled on DefaultLdapRealm or JndiLdapRealm. Apache published the advisory on November 14, 2026.
  • Every release through 3.0.0 is affected. The fix shipped in 3.0.1 on August 23, 2026, and the current 3.0.2 release also carries it. Authentication caching is off by default.
  • Apache rates the flaw CVSS v4.0 9.1 Critical. No exploitation in the wild is known, no public proof of concept is linked, and the CVE is not in CISA KEV as of November 15, 2026.
  • Upgrade to Apache Shiro 3.0.2 or later. Deployments that cannot upgrade yet should turn off authentication caching on their LDAP realm. See "How do I fix it?".

Am I affected?

All of these must hold:

  • The application uses Apache Shiro 3.0.0 or earlier, or an end-of-life 1.x or 2.x release. The advisory covers every release through 3.0.0.
  • The LDAP realm is DefaultLdapRealm or its subclass JndiLdapRealm. Other realm types are outside this flaw.
  • Authentication caching is enabled on that realm (authenticationCachingEnabled = true), and a cache manager is configured. The setting defaults to false.
  • The account an attacker targets has completed a successful login since the authentication cache was last cleared, so its authentication information is cached.

The attacker also needs a valid username. No password is needed. Applications that use a custom realm, a database realm or a realm that binds to a different directory are not affected by this CVE.

Branch Affected versions Fixed version
3.x 3.0.0 and earlier 3.0.1 or later
2.x (end of life 2026-06-29) All 2.x releases No community fix; upgrade to 3.0.2
1.x (end of life 2024-02-28) All 1.x releases No community fix; upgrade to 3.0.2

Check the Shiro version in a Maven build:

mvn dependency:tree -Dincludes=org.apache.shiro

In a Gradle build:

./gradlew dependencyInsight --dependency shiro-core --configuration runtimeClasspath

In a packaged Spring Boot application:

unzip -l application.jar | grep 'BOOT-INF/lib/shiro-core'

Then check the realm configuration. This searches Java and INI configuration files:

grep -R -n -E "authenticationCachingEnabled|setAuthenticationCachingEnabled" /path/to/application/config

An INI file enables the risky path with a line such as ldapRealm.authenticationCachingEnabled = true. A Java configuration calls setAuthenticationCachingEnabled(true) on the realm.

How do I fix it?

Upgrade every Shiro artifact to 3.0.2 or later. That release contains the fix for this CVE and the other advisories Apache published in the same batch.

  1. Update the dependency in Maven. Use the same version for every org.apache.shiro artifact so shiro-core, shiro-web and shiro-spring stay aligned.
<dependency>
  <groupId>org.apache.shiro</groupId>
  <artifactId>shiro-core</artifactId>
  <version>3.0.2</version>
</dependency>
  1. Spring Boot applications that use the starter update the starter instead. It brings the matching core and web artifacts.
<dependency>
  <groupId>org.apache.shiro</groupId>
  <artifactId>shiro-spring-boot-web-starter</artifactId>
  <version>3.0.2</version>
</dependency>
  1. Gradle builds use the same coordinates.
implementation 'org.apache.shiro:shiro-core:3.0.2'
  1. Rebuild and redeploy the application, then repeat the dependency check. Every org.apache.shiro artifact in the tree must report 3.0.2. A partial upgrade that moves only shiro-core leaves the web and Spring modules on the old release.

If you cannot upgrade yet, turn off authentication caching on the LDAP realm:

  1. In INI configuration, set ldapRealm.authenticationCachingEnabled = false, or remove the line. The default is false.
  2. In Java configuration, call setAuthenticationCachingEnabled(false) on the realm before it is initialized.
  3. Restart the application and confirm the realm performs an LDAP bind on every login.

Disabling caching restores the directory bind for each login, which is the check the flaw bypasses. It adds LDAP traffic and latency on every login, and it does not fix the other Shiro CVEs from the November batch. A second workaround is to install SimpleCredentialsMatcher on the realm, which verifies the submitted password against the cached credentials. That reproduces what 3.0.1 does by default, but it is easy to misconfigure, so prefer the upgrade.

What is the root cause?

DefaultLdapRealm installed AllowAllCredentialsMatcher, a matcher that accepts every submitted credential, because the LDAP directory was supposed to check the password during the bind.

This is the constructor in DefaultLdapRealm.java at 3.0.0:

public DefaultLdapRealm() {
    //Credentials Matching is not necessary - the LDAP directory will do it automatically:
    setCredentialsMatcher(new AllowAllCredentialsMatcher());
    //Any Object principal and Object credentials may be passed to the LDAP provider, so accept any token:
    setAuthenticationTokenClass(AuthenticationToken.class);
    this.contextFactory = new JndiLdapContextFactory();
}

With caching off, every login reaches doGetAuthenticationInfo, which calls queryForAuthenticationInfo. That method opens an LDAP context with the submitted principal and credentials. A failed bind throws an exception, so the password is checked by the directory and the allow-all matcher never matters.

Caching changes the path. This is AuthenticatingRealm.getAuthenticationInfo at 3.0.0:

AuthenticationInfo info = getCachedAuthenticationInfo(token);
if (info == null) {
    //otherwise not cached, perform the lookup:
    info = doGetAuthenticationInfo(token);
    if (token != null && info != null) {
        cacheAuthenticationInfoIfPossible(token, info);
    }
} else {
    LOGGER.debug("Using cached authentication info [{}] to perform credentials matching.", info);
}

if (info != null) {
    assertCredentialsMatch(token, info);
}

On a cache hit, the code skips doGetAuthenticationInfo, so no LDAP bind happens. It still calls assertCredentialsMatch, which invokes the realm's credentials matcher. That matcher is AllowAllCredentialsMatcher, and it returns true for any token.

The cached entry contains the credentials from the first successful login. This is createAuthenticationInfo at 3.0.0:

return new SimpleAuthenticationInfo(token.getPrincipal(), token.getCredentials(), getName());

The realm stores the submitted password as the account credential. A matcher that compares credentials would require the same password at the next login. The allow-all matcher never compares anything, so the cached password is ignored too.

How is it exploited?

An attacker who knows a valid username submits any password, and the cached authentication path grants a session as that user.

  1. The application enables authentication caching on a DefaultLdapRealm and configures a cache manager.
  2. A legitimate user logs in. The realm binds to LDAP, builds an AuthenticationInfo that carries the username and that user's password, and caches it under the user's principal.
  3. The attacker learns a valid username from a login error, a directory listing, an email address or another public source. The attacker does not need the password.
  4. The attacker submits the username and an arbitrary password to the application's login endpoint.
  5. getCachedAuthenticationInfo returns the cached entry, so the realm skips doGetAuthenticationInfo and the LDAP bind.
  6. assertCredentialsMatch calls AllowAllCredentialsMatcher, which returns true, and Shiro creates a session for the victim's principal with the victim's roles and permissions.

No public proof of concept is linked in the advisory or in the public record. The path is visible in the source at the tags cited in "References", and the advisory describes the same sequence.

How does the attack flow?

The attacker supplies a known username with any password. The cached authentication entry is returned instead of an LDAP bind, and the allow-all matcher turns the cache hit into a session for the victim.

flowchart LR A["Attacker knows
a valid username"] --> B["Submits any
password"] B --> C["Cached AuthenticationInfo
found for the user"] C --> D["LDAP bind
skipped"] D --> E["AllowAllCredentialsMatcher
returns true"] E --> F["Session for
the victim"] F --> G["Victim's roles
and data"]

Timeline of CVE-2026-129349: the 3.0.1 fix on August 23, 2026 and the advisory on November 14, 2026
Figure 1: The fix shipped in 3.0.1 on August 23, 2026, and Apache published CVE-2026-129349 on November 14, 2026. Source: Apache Shiro releases and advisory, checked November 15, 2026

What can an attacker do?

An attacker can sign in as any user whose authentication information is cached, including an administrator, and inherit that user's roles and permissions.

The conditions are part of the impact:

  • The LDAP realm must have authentication caching enabled and a cache manager configured. The default is off.
  • The targeted account must have logged in successfully since the cache was last cleared. A cold cache or an expired entry blocks the attack until the user logs in again.
  • The attacker must know the username. A username that is not in the cache produces a normal failed login.
  • The application's login endpoint must be reachable. No user interaction, password or special network position is required beyond that reach.

The flaw does not execute code and does not read the LDAP directory. Its impact is account takeover inside the application, with whatever authorization the victim holds. If the same realm supplies roles, the attacker receives the victim's roles from the directory. If authorization is separate, the attacker still acts as the victim and reaches the data that account can read or change.

No exploitation in the wild is known, and no victim is named in the public record.

Why does the fix work?

The fix removes the allow-all matcher from the realm, so the inherited SimpleCredentialsMatcher compares the submitted password with the password stored in the cached authentication entry.

This is the change from 3.0.0 to 3.0.1 in DefaultLdapRealm.java:

 public DefaultLdapRealm() {
-    //Credentials Matching is not necessary - the LDAP directory will do it automatically:
-    setCredentialsMatcher(new AllowAllCredentialsMatcher());
     //Any Object principal and Object credentials may be passed to the LDAP provider, so accept any token:
     setAuthenticationTokenClass(AuthenticationToken.class);
     this.contextFactory = new JndiLdapContextFactory();
 }

SimpleCredentialsMatcher compares the token's credentials with the cached AuthenticationInfo credentials. The cached entry holds the password from the first successful LDAP bind, so a later login must present the same password. A different password now fails on the cache-hit path. The 3.0.1 test for the realm asserts that the default matcher is SimpleCredentialsMatcher.

The fix is complete for DefaultLdapRealm and JndiLdapRealm. It does not protect an application that installs AllowAllCredentialsMatcher itself, and it does not change the caching behavior or the lifetime of cached entries. A deployment with a custom realm should check its own matcher.

How do I check if I was compromised?

No indicators of compromise are published. The useful check is a mismatch between successful application logins and LDAP bind events for the same account and time.

  • Shiro logs a cache hit at DEBUG level in AuthenticatingRealm: Using cached authentication info [...] to perform credentials matching. Enable DEBUG for org.apache.shiro.realm.AuthenticatingRealm if the application still has the logs. Correlate those lines with successful logins.
  • Compare the application's authentication log with the directory's bind log. A successful login in the application with no matching bind for that user is a lead, because the cached path skips the bind.
  • Review successful logins to privileged accounts from new IP addresses, new user agents or unusual times, especially for accounts that were active shortly before the login.
  • Check the cache configuration and its contents where the cache exposes them. An entry for an account that should not be cached is a lead.

A failed attempt with an unknown username leaves an ordinary failed login. A cache miss leaves no sign of an attack. With no published indicators, absence of evidence is not proof that the path was not used.

Timeline

  • 2026-08-20: The fix commit c3cfcf752d removes the AllowAllCredentialsMatcher default from DefaultLdapRealm.
  • 2026-08-23: Apache Shiro 3.0.1 is released with the fix.
  • 2026-11-08: Apache Shiro 3.0.2 is released with fixes for the rest of the November advisory batch.
  • 2026-11-14: Apache publishes the CVE-2026-129349 advisory.

FAQ

Does this affect a Shiro application that uses a database realm?

No. The flaw is in DefaultLdapRealm and its JndiLdapRealm subclass. A realm that authenticates against a database or another store does not install this matcher, so this CVE does not apply to it.

Is authentication caching on by default?

No. authenticationCachingEnabled defaults to false, and caching also requires a cache manager. A deployment that never enabled the setting and never configured a cache is not exposed, even on 3.0.0.

Do I need to upgrade if I already run 3.0.1?

3.0.1 fixes this CVE. It does not fix the other Shiro advisories Apache published on 2026-11-14, which are fixed in 3.0.2. Upgrade to 3.0.2 or later so one release covers the whole batch.

Is it exploited in the wild?

No exploitation in the wild is known. The CVE is not in CISA KEV as of November 15, 2026, and the advisory links no public proof of concept. The absence of a public exploit does not remove the exposure when caching is enabled.

Can an attacker log in as any user?

Only as a user whose authentication information is cached and whose username the attacker knows. A cold cache, an expired entry or an unknown username blocks the attack. Once the target has logged in and the entry is present, no password is required.

Why does a flaw that needs a non-default setting score 9.1?

The CVSS v4.0 vector describes the flaw when the setting is on: network reach, no privileges, no user interaction and high confidentiality and integrity impact. The base vector is CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N. The AT:P component reflects the precondition. The score measures the impact of the vulnerable configuration, not how common that configuration is.

Find Java applications that ship Apache Shiro with Ostorlab

Ostorlab's software composition analysis inventories the Apache Shiro version in your Java applications and container images. That shows which services are still on 3.0.0 or earlier before you plan the upgrade. Scan your dependencies with Ostorlab.

References

  • Apache Shiro security reports, including CVE-2026-129349, its affected versions, the Critical rating, the fix in 3.0.1 and the workarounds: https://shiro.apache.org/security-reports.html (checked November 15, 2026)
  • Apache Shiro advisory for CVE-2026-129349 on the oss-security mailing list, November 14, 2026, with the CVSS v4.0 9.1 score and vector: https://www.openwall.com/lists/oss-security/2026/11/14/8 (checked November 15, 2026)
  • The fix commit c3cfcf752d, "bugfix: removed unnecessary setCredentialsMatcher() call in DefaultLdapRealm", August 20, 2026: https://github.com/apache/shiro/commit/c3cfcf752d784444497aa60abd305aa135329c5b (checked November 15, 2026)
  • Apache Shiro 3.0.1 release, August 23, 2026: https://github.com/apache/shiro/releases/tag/shiro-root-3.0.1 (checked November 15, 2026)
  • Apache Shiro 3.0.2 release, November 8, 2026: https://github.com/apache/shiro/releases/tag/shiro-root-3.0.2 (checked November 15, 2026)
  • DefaultLdapRealm.java at 3.0.0, with the constructor, doGetAuthenticationInfo and createAuthenticationInfo: https://github.com/apache/shiro/blob/shiro-root-3.0.0/core/src/main/java/org/apache/shiro/realm/ldap/DefaultLdapRealm.java (checked November 15, 2026)
  • AuthenticatingRealm.java at 3.0.0, with the cache-hit path and getAuthenticationInfo: https://github.com/apache/shiro/blob/shiro-root-3.0.0/core/src/main/java/org/apache/shiro/realm/AuthenticatingRealm.java (checked November 15, 2026)
  • Maven Repository page for org.apache.shiro:shiro-core, showing 817 artifacts that depend on it: https://mvnrepository.com/artifact/org.apache.shiro/shiro-core (checked November 15, 2026)
  • CISA Known Exploited Vulnerabilities catalog, with no entry for CVE-2026-129349: https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json (checked November 15, 2026)