Summary
OpenAM's MSISDN authentication module inserts a request-supplied phone number into an LDAP search filter without escaping it. If the module is enabled in a reachable authentication chain, an unauthenticated remote attacker may manipulate the search and obtain a normal authenticated session as a matching user without that user's password.
Affected context
The issue affects OpenAM realms where the MSISDN authentication module is enabled in an authentication chain reachable by an attacker. The risk is heightened when the trusted-gateway list is empty, because the default configuration allows traffic from all sources.
Exploit preconditions
- Attack surface: A remotely reachable OpenAM authentication flow
- Required access: No prior authentication; the vulnerable flow must accept requests from the attacker
- Trigger point: Processing of the request-supplied MSISDN during LDAP lookup
- Why exploitation is possible: The MSISDN value is incorporated into an LDAP filter without escaping, and an empty trusted-gateway list does not restrict access
Why this happens
The MSISDN authentication module constructs an LDAP search filter using request data without applying LDAP-specific escaping or equivalent safe query construction. Filter metacharacters can therefore alter the query's meaning, mapping to CWE-90: Improper Neutralization of Special Elements used in an LDAP Query. A manipulated lookup may select a user account and allow the authentication flow to issue a session without password verification.
Potential impact
- An attacker could obtain an authenticated OpenAM session without a password
- The attacker may gain access to resources available to the selected user
- Accounts with elevated permissions could be exposed if they are selectable through the affected lookup
- Compromised sessions could be used for further unauthorized actions
General mitigation guidance
Defensive patterns include:
- Build LDAP queries with APIs that safely handle filter values, or apply correct LDAP filter escaping before incorporating input
- Validate and normalize MSISDN values against a strict, documented format and reject unexpected characters
- Configure trusted gateways explicitly and default to denying untrusted sources
- Review authentication-chain reachability and limit access to the MSISDN flow to intended contexts
- Ensure authentication decisions require the appropriate proof of identity rather than relying solely on a manipulable directory lookup
- Apply least privilege to service accounts and constrain what authenticated sessions can access
How teams detect issues like this
- Use static analysis and code review to identify LDAP filters assembled through string concatenation with request-controlled values
- Review MSISDN validation paths for LDAP-specific escaping, strict input validation, and fail-closed behavior
- Audit realm configuration for reachable MSISDN authentication chains and empty or overly broad trusted-gateway lists
- Monitor authentication and directory logs for unusual MSISDN inputs, unexpected lookup results, and anomalous session issuance
- Use security policies or automated review checks to flag unsafe LDAP query construction

