CVE-2025-52575
Executive Summary
CVE-2025-52575 is a blind LDAP injection vulnerability in EspoCRM versions 9.1.6 and earlier. When LDAP authentication is enabled, a remote, unauthenticated attacker can inject crafted input containing wildcard characters (e.g., *) into LDAP queries. This can lead to authentication bypass, username enumeration, or retrieval of sensitive directory information depending on the LDAP server configuration. The vulnerability is fixed in version 9.1.7. The EPSS score is 0.0%, indicating low exploitation activity in the wild, but the risk remains significant for organizations using LDAP authentication with EspoCRM.
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
Supply Chain & Package Security
This vulnerability is not related to NPM, PyPI, Go, or Ruby packages. It is a direct vulnerability in the EspoCRM PHP application.
CVSS Breakdown & Threat Level
- CVSS Score: 6.5 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. The vulnerability allows unauthenticated remote attackers to perform blind LDAP injection, potentially bypassing authentication and enumerating users. However, exploitation requires LDAP authentication to be enabled, and the impact is limited to information disclosure and authentication bypass, not full system compromise.
Deep Dive & Mechanics
The vulnerability exists in the LDAP authentication module of EspoCRM. When a user attempts to authenticate via LDAP, the application constructs an LDAP query using user-supplied input (e.g., username) without proper sanitization. An attacker can inject wildcard characters (*) into the username field, causing the LDAP query to match multiple entries or bypass authentication logic.
For example, if the application performs a search filter like (&(objectClass=user)(sAMAccountName={username})), an attacker can input * to match all users, or admin* to enumerate usernames starting with "admin". In blind injection scenarios, the attacker can infer valid usernames or attributes based on the application's response (e.g., successful login vs. failure).
The vulnerability is classified as CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection').
Vulnerable vs. Patched Code
Vulnerable Code (version 9.1.6 and earlier): The LDAP authentication module likely constructs queries using string concatenation or interpolation without escaping special characters.
// Vulnerable example
$filter = "(&(objectClass=user)(sAMAccountName=" . $username . "))";
$result = ldap_search($ldapconn, $base_dn, $filter);
Patched Code (version 9.1.7):
The patched version properly escapes LDAP special characters using ldap_escape() or similar functions.
// Patched example
$filter = "(&(objectClass=user)(sAMAccountName=" . ldap_escape($username, "", LDAP_ESCAPE_FILTER) . "))";
$result = ldap_search($ldapconn, $base_dn, $filter);
Exploitation & Lab Setup
Red Team
Prerequisites:
- EspoCRM version 9.1.6 or earlier with LDAP authentication enabled.
- Network access to the EspoCRM login page.
Exploitation Steps:
- Identify the EspoCRM login page (e.g.,
https://target.com/). - Attempt to authenticate with a crafted username containing wildcard characters.
- Example:
*as username, any password. - Example:
admin*as username, any password.
- Example:
- Observe the application response:
- If authentication succeeds (even with wrong password), the injection is successful.
- If different error messages appear for valid vs. invalid usernames, blind enumeration is possible.
Blind Enumeration:
- Use a script to send requests with usernames like
a*,b*, etc., and analyze response times or error messages to infer valid usernames.
No public exploit code is available for this CVE.
Blue Team
Detection:
- Monitor LDAP authentication logs for unusual patterns, such as usernames containing wildcard characters (
*,?,(). - Look for repeated authentication attempts with varying usernames (enumeration behavior).
- Alert on successful authentication with usernames that do not match expected patterns.
Hunting:
- Search web server logs for requests to the login endpoint with suspicious username parameters.
- Correlate with LDAP server logs for queries containing wildcard characters.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP POST requests to
/or/api/v1/loginwithusernameparameter containing*,?, or other LDAP special characters. - Repeated authentication attempts with different usernames in a short time frame.
- HTTP POST requests to
Log IOCs:
- LDAP server logs showing search filters with wildcard characters (e.g.,
sAMAccountName=*). - EspoCRM application logs showing failed authentication attempts with unusual usernames.
- LDAP server logs showing search filters with wildcard characters (e.g.,
File IOCs:
- Modified EspoCRM configuration files enabling LDAP authentication (if not previously enabled).
Detection Engineering
YARA Rule
rule CVE_2025_52575_LDAP_Injection {
meta:
description = "Detects LDAP injection attempts in EspoCRM logs"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-52575"
strings:
$ldap_inject = /username=[^&]*[\*\?\(\)]/
condition:
$ldap_inject
}
Sigma Rule
title: EspoCRM LDAP Injection Attempt
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects LDAP injection attempts in EspoCRM authentication logs
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-52575
logsource:
category: application
product: espocrm
detection:
selection:
EventID: 4625 # Failed logon
TargetUserName|contains:
- '*'
- '?'
- '('
- ')'
condition: selection
falsepositives:
- Legitimate usernames containing special characters (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-52575 EspoCRM LDAP Injection Attempt"; flow:to_server; content:"POST"; http_method; content:"/api/v1/login"; http_uri; content:"username="; nocase; pcre:"/username=[^&]*[\*\?\(\)]/"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade EspoCRM to version 9.1.7 or later.
- If immediate upgrade is not possible, disable LDAP authentication temporarily.
- Implement Web Application Firewall (WAF) rules to block requests containing LDAP special characters in the username field.
Long-term Mitigations:
- Ensure all user input is properly sanitized and escaped before being used in LDAP queries.
- Conduct regular security audits and penetration testing.
- Monitor for unusual authentication patterns.
Workarounds:
- Restrict network access to the EspoCRM login page to trusted IPs only.
- Enable multi-factor authentication (MFA) to reduce the impact of authentication bypass.
Valters IT
DevSecOps & Cyber Threat Intelligence Expert