---
id: CVE-2026-49268
title: 'Apache Shiro: LDAP DN Injection in DefaultLdapRealm'
summary: 'Apache Shiro: LDAP DN Injection in DefaultLdapRealm'
severity: high
cwe:
  - CWE-90
vendor: apache
product: 'org.apache.shiro:shiro-core'
ecosystem: maven
affected:
  - 'org.apache.shiro:shiro-core < 2.2.1'
  - 'org.apache.shiro:shiro-core >= 3.0.0-alpha-0, < 3.0.0-alpha-2'
patched:
  - 'org.apache.shiro:shiro-core 2.2.1'
  - 'org.apache.shiro:shiro-core 3.0.0-alpha-2'
published: '2026-06-17'
updated: '2026-06-18'
source: GHSA
sourceUrl: 'https://github.com/advisories/GHSA-x96m-rh44-vgv8'
references:
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-49268'
  - url: 'https://lists.apache.org/thread/svszql3od8td7hn6conyj2oq70v53b5s'
  - url: 'http://www.openwall.com/lists/oss-security/2026/06/17/8'
  - url: 'https://github.com/advisories/GHSA-x96m-rh44-vgv8'
tags:
  - ghsa
  - maven
  - exploit-available
epss: 0.00755
epssPercentile: 0.53125
ingestedAt: '2026-06-29T14:31:47.208Z'
exploits:
  github: 2
  githubRepos:
    - 'https://github.com/xiaoqiMikko/shiro-check'
    - 'https://github.com/sassoftware/shiro'
  checkedAt: '2026-09-25T08:21:00.229Z'
exploitAvailable: true
---

## Overview

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.

## Affected packages

- `org.apache.shiro:shiro-core < 2.2.1`
- `org.apache.shiro:shiro-core >= 3.0.0-alpha-0, < 3.0.0-alpha-2`

## Remediation

Upgrade to a patched release:

- `org.apache.shiro:shiro-core 2.2.1`
- `org.apache.shiro:shiro-core 3.0.0-alpha-2`
