# CVE-2026-49268: Apache Shiro: LDAP DN Injection in DefaultLdapRealm

> Remote attackers can bypass authentication or impersonate users by injecting LDAP special characters into the DN construction in Apache Shiro's DefaultLdapRealm.

- **Severity:** High 8.8 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:H/VA:N/SC:N/SI:N/SA:N/S:P/AU:Y/R:A/RE:L/U:Red`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 17 Jun 2026
- **Updated:** 17 Jun 2026
- **Also known as:** CLEANSTART-2026-FA74097, CLEANSTART-2026-LY45593, DEBIAN-CVE-2026-49268, ECHO-985f-7fd1-0025, GHSA-x96m-rh44-vgv8, MINI-233j-5pg3-fr3v, MINI-342r-fw74-77f4, MINI-3g7g-5c6g-ph96, MINI-3mc7-v4fp-4q5x, MINI-49mr-v8fh-2254, MINI-5h3g-jmg3-vxvq, MINI-677g-45wv-g5g4, MINI-6qg3-hchj-q3wx, MINI-6rqh-9crg-92w3, MINI-7jxr-g2q7-mqrq, MINI-7m68-45g5-x6g9, MINI-8728-r4h3-rpcj, MINI-9h4c-rmg2-9gqm, MINI-9r2v-5h7x-2734, MINI-c67f-5mvg-p9q4, MINI-f7p4-3vw6-g53x, MINI-fp5w-q9qq-f98x, MINI-gmhx-6vf5-5482, MINI-gqqv-qh95-3x5x, MINI-jhcp-rh3h-h679, MINI-qhc4-cvjv-qc7v, MINI-r337-4phg-jgx5, MINI-w96j-8xrx-52vr, MINI-wgvf-h4j8-h4x2, UBUNTU-CVE-2026-49268

## What is CVE-2026-49268?

CVE-2026-49268 is a high-severity authentication bypass vulnerability in Apache Shiro, published on 17 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

Weakness: CWE-90 (Improper Neutralization of Special Elements used in an LDAP Query)

## Which versions are affected by CVE-2026-49268?

4 open source packages ship an affected version, including org.apache.shiro:shiro-core. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.shiro:shiro-core` | Maven | All versions | 2.2.1 |
| `org.apache.shiro:shiro-core` | Maven | All versions | 2.2.1 |
| `org.apache.shiro:shiro-core` | Maven | From 3.0.0-alpha-0 | 3.0.0-alpha-2 |
| `org.apache.shiro:shiro-core` | Maven | From 3.0.0-alpha-0 | 3.0.0-alpha-2 |

Products: Apache Shiro.

## How do I fix CVE-2026-49268?

Upgrade org.apache.shiro:shiro-core to a fixed version for your release line: 2.2.1 or 3.0.0-alpha-2.

## Is CVE-2026-49268 being exploited?

There is no known exploitation of CVE-2026-49268 in the wild and no public exploit code.

Public exploit code:

- CVE-2026-49268 — Analysis and Remediation of an LDAP Injection Authentication Bypass Vulnerability (github_poc): https://github.com/sassoftware/shiro
- 扫出你实际装的 Apache Shiro 模块与版本,逐条判定官方 26 条 CVE 里哪些真的落在你身上。按「CVE × 模块」判定,零依赖单 jar。 CVE-2026-49268 (github_poc): https://github.com/xiaoqiMikko/shiro-check

## Other vulnerabilities in Apache Shiro

- [CVE-2023-34478](https://insights.sbomify.com/CVE-2023-34478/): Path Traversal in Apache Shiro (critical 9.8)
- [CVE-2022-40664](https://insights.sbomify.com/CVE-2022-40664/): Authentication Bypass Vulnerability in Shiro when forwarding or including via RequestDispatcher (critical 9.8)
- [CVE-2022-32532](https://insights.sbomify.com/CVE-2022-32532/): Authentication Bypass Vulnerability (critical 9.8)
- [CVE-2021-41303](https://insights.sbomify.com/CVE-2021-41303/): Apache Shiro vulnerable to a specially crafted HTTP request causing an authentication bypass (critical 9.8)
- [CVE-2020-17523](https://insights.sbomify.com/CVE-2020-17523/): Authentication bypass in Apache Shiro (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-49268 and fix it if it is affected.

What it is: CVE-2026-49268 is a high-severity authentication bypass vulnerability in Apache Shiro, published on 17 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-49268 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.apache.shiro:shiro-core (Maven): affected all versions; fixed in 2.2.1
- org.apache.shiro:shiro-core (Maven): affected all versions; fixed in 2.2.1
- org.apache.shiro:shiro-core (Maven): affected from 3.0.0-alpha-0; fixed in 3.0.0-alpha-2
- org.apache.shiro:shiro-core (Maven): affected from 3.0.0-alpha-0; fixed in 3.0.0-alpha-2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-49268/ (Markdown: https://insights.sbomify.com/CVE-2026-49268/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-49268
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-49268
- OSV: https://osv.dev/vulnerability/CVE-2026-49268

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-49268/
Summaries are generated and may contain mistakes; the official description above is the record.
