---
id: "CVE-2026-41573"
kind: "vulnerability"
aliases: ["CVE-2026-41573", "GHSA-2vg8-q4c2-5cw3"]
title: "OpenAM has LDAP Injection via `_queryId` Parameter"
severity: "high"
cvss: 7.1
epss: 0.00496
exploited: false
status: "open"
category: "package"
products: [{"name": "org.openidentityplatform.openam:openam-core-rest", "fixed": ["16.1.1"], "affected": "<= 16.0.6", "ecosystem": "maven"}]
ecosystems: ["maven"]
tags: ["cwe-74", "cwe-90", "identity", "java", "ldap", "openam", "package", "self-hosted"]
not_affected_if: ["auth-required", "fixed-version"]
published_at: "2026-06-22T19:59:33+00:00"
first_seen_at: "2026-10-28T15:29:41+00:00"
updated_at: "2026-10-28T15:33:37+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-2vg8-q4c2-5cw3", "first_seen_at": "2026-10-28T15:29:41+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-41573", "first_seen_at": "2026-10-28T15:33:37+00:00"}]
---

# OpenAM has LDAP Injection via `_queryId` Parameter

OpenAM's CREST user and group query endpoints pass the _queryId parameter into an LDAP filter without escaping, because escaping is explicitly turned off. An authenticated user can inject LDAP metacharacters to enumerate users and run blind LDAP injection against the directory.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- maven:org.openidentityplatform.openam:openam-core-rest affected <= 16.0.6 fixed 16.1.1

## How to check

- Look for the `openam-core-rest` Maven dependency and its version in your build files or `pom.xml`, for example with `mvn dependency:tree | grep openam-core-rest`.
- Check whether your deployment exposes `/openam/json/{realm}/users` or `/openam/json/{realm}/groups` to users who hold an SSO token.

## Fix

- Upgrade `org.openidentityplatform.openam:openam-core-rest` to `16.1.1` or later.
- Until the upgrade is done, restrict access to the `/json/{realm}/users` and `/json/{realm}/groups` endpoints at the reverse proxy or load balancer.

## Timeline

- 2026-10-28T15:29:41+00:00 ghsa https://github.com/advisories/GHSA-2vg8-q4c2-5cw3
- 2026-10-28T15:33:37+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-41573

## From the sources

OpenAM (Open Identity Platform) is an open-source IAM platform providing SSO, OAuth2, SAML, and OpenID Connect capabilities. The CREST REST API layer exposes user query endpoints under `/json/{realm}/users`. In `IdentityResourceV1.queryCollection()`, the HTTP query parameter `_queryId` is passed to a `CrestQuery` object with `escapeQueryId` **explicitly set to `false`**, bypassing the escape protection introduced as part of the CVE-2021-29156 fix. The unescaped value flows directly to `DJLDAPv3Repo.getFilter()` where it is concatenated into an LDAP filter string without sanitization, enabling authenticated attackers to inject arbitrary LDAP metacharacters for user enumeration and blind LDAP injection.

## Affected Endpoint

| Endpoint | Auth Required | Injection Parameter |
|----------|--------------|---------------------|
| `GET /openam/json/{realm}/users?_queryId=<INJECTION>` | SSO Token | `_queryId` |
| `GET /openam/json/{realm}/groups?_queryId=<INJECTION>` | SSO Token (TBD) | `_queryId` |

## Background: CVE-2021-29156

CVE-2021-29156 was a pre-authentication LDAP injection in OpenAM's Webfinger endpoint, where user-supplied input reached `DJLDAPv3Repo.getFilter()` unescaped. The fix introduced the `escapeQueryId` flag in `CrestQuery` (defaulting to `true`) and added `Filter.escapeAssertionValue()` in the filter-building path:

## Credit

Discovered by **JD-Security SHENYI Team**

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
