CVE-2026-49268
Apache Shiro vulnerability analysis and mitigation

Overview

CVE-2026-49268 is an LDAP DN Injection vulnerability in Apache Shiro's DefaultLdapRealm class that allows remote, unauthenticated attackers to bypass authentication or impersonate other users by injecting RFC 2253 special characters into LDAP Distinguished Name (DN) construction. It affects all Apache Shiro versions through 2.2.0 and 3.0.0-alpha-0 through 3.0.0-alpha-1 when DefaultLdapRealm is in use. The vulnerability was reported by zhaokaifei of ChinaTelecom, remediated by Lenny Primak, and publicly disclosed on June 17, 2026 (Apache Advisory, oss-security). It carries a CVSS v3.1 base score of 9.1 (Critical) and a CVSS v4.0 base score of 8.8 (High) (GitHub Advisory).

Technical details

The root cause is CWE-90 (Improper Neutralization of Special Elements used in an LDAP Query — LDAP Injection): user-supplied username input is directly concatenated into the LDAP DN template within the DefaultLdapRealm class without escaping RFC 2253 special characters (e.g., ,, =, +, <, >, #, ;, \, "). An attacker can craft a malicious username containing these characters to alter the DN structure used during LDAP bind authentication, effectively redirecting the bind to a different directory entry or bypassing credential validation entirely. The attack is network-accessible, requires no authentication or user interaction, and has low complexity — making it automatable at scale (GitHub Advisory, oss-security). No public proof-of-concept code has been identified at this time (Feedly).

Impact

Successful exploitation allows an unauthenticated remote attacker to bypass LDAP-based authentication entirely or impersonate arbitrary users within the application, resulting in high integrity impact (unauthorized access and actions as another user) and partial confidentiality impact (access to data scoped to the impersonated account). Availability is not directly affected. In environments where Apache Shiro gates access to sensitive business applications or APIs, a successful authentication bypass could enable lateral movement, privilege escalation, or unauthorized data access across the protected system (GitHub Advisory, Feedly).

Exploitation steps

  1. Reconnaissance: Identify applications using Apache Shiro versions ≤ 2.2.0 or 3.0.0-alpha-0/alpha-1 with DefaultLdapRealm configured for LDAP authentication. This can be done via HTTP response headers, error messages, or dependency scanning tools (e.g., Dependency-Check, Syft).
  2. Identify the login endpoint: Locate the application's login form or API endpoint that accepts a username and password and delegates authentication to Shiro's DefaultLdapRealm.
  3. Craft a malicious username: Construct a username payload containing RFC 2253 LDAP special characters (e.g., ,, =, +, \) to manipulate the DN template. For example, if the DN template is uid={0},ou=users,dc=example,dc=com, a username like admin,ou=admins,dc=example,dc=com# could redirect the bind to a different DN.
  4. Submit the crafted request: Send the login request with the injected username (and any arbitrary password) to the target endpoint via HTTP POST.
  5. Achieve authentication bypass or impersonation: If the LDAP server processes the manipulated DN and the bind succeeds (e.g., against an account with a known or empty password, or via anonymous bind), the attacker gains access as the targeted user without valid credentials (GitHub Advisory, oss-security).

Indicators of compromise

  • Network: Unusual login requests containing RFC 2253 special characters (,, =, +, <, >, #, ;, \) in the username field of HTTP POST requests to the application's authentication endpoint.
  • Logs: Application or Shiro security logs showing authentication attempts with malformed or structurally unusual usernames; LDAP server logs recording bind attempts against unexpected or non-standard DNs; repeated failed or anomalous bind attempts from a single source IP.
  • Logs: Successful authentication events for privileged or administrative accounts from unexpected source IPs or at unusual times, particularly where the username in the log contains special characters.
  • Process/Application: Shiro DefaultLdapRealm debug logs (if enabled) showing DN construction with injected characters; Java exceptions related to LDAP DN parsing that are subsequently suppressed or handled.

Mitigation and workarounds

Upgrade to Apache Shiro 2.2.1 (for the 2.x branch) or 3.0.0-alpha-2 (for the 3.x alpha branch), which fix the issue by properly escaping RFC 2253 special characters in LDAP DN construction (Apache Advisory, GitHub Advisory). If immediate patching is not possible, implement server-side input validation to reject or escape RFC 2253 special characters in username fields before they reach the DefaultLdapRealm DN template. Additionally, consider restricting LDAP server permissions to limit the impact of any successful DN manipulation.

Community reactions

The vulnerability was covered by SecurityOnline.info shortly after disclosure, and the advisory was distributed via the Apache announce mailing list and oss-security (oss-security, Apache Announce). The reporter (zhaokaifei, ChinaTelecom) and remediation developer (Lenny Primak) were credited in the official advisory. Community tracking was observed across vulnerability aggregators including VulnDB, CVEFeed, and OSV within hours of disclosure (Feedly).

Additional resources


SourceThis report was generated using AI

Related Apache Shiro vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-49268HIGH8.8
  • Apache Shiro logoApache Shiro
  • org.apache.shiro:shiro-core
NoYesJun 17, 2026
CVE-2023-46749MEDIUM6.5
  • Apache Shiro logoApache Shiro
  • shiro
NoYesJan 15, 2024
CVE-2026-43827MEDIUM5.9
  • Apache Shiro logoApache Shiro
  • apache-activemq-6.2
NoYesMay 25, 2026
CVE-2026-23903MEDIUM5.3
  • Java logoJava
  • org.apache.shiro:shiro-core
NoYesFeb 09, 2026
CVE-2026-23901LOW1
  • Apache Shiro logoApache Shiro
  • shiro
NoYesFeb 10, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management