Summary
Chamilo LMS 2.0-RC.2 exposes an unauthenticated AJAX endpoint that accepts arbitrary Symfony Mailer DSN strings and uses them to connect to attacker-controlled SMTP servers.
This allows an attacker to perform Server-Side Request Forgery (SSRF) into internal networks over SMTP, abuse the server as an open email relay for phishing and spam, and glean information about internal network topology from error responses.
Affected context
The vulnerability exists in Chamilo LMS 2.0-RC.2 on fully installed instances where public/main/inc/ajax/install.ajax.php remains reachable over the network.
Unlike other AJAX endpoints, this file does not include the global bootstrap (global.inc.php) that enforces authentication and installation-state checks.
As a result, the test_mailer action can be triggered without logging in, allowing arbitrary SMTP connection attempts initiated from the Chamilo server to destinations chosen by the attacker.
Exploit preconditions
- Attack surface: Network-exposed Chamilo LMS instances running version 2.0-RC.2 with public access to
public/main/inc/ajax/install.ajax.php. - Required access: No prior authentication or local access is required; the attacker only needs HTTP(S) access to the vulnerable endpoint.
- Trigger point: Sending an HTTP POST request to the
test_maileraction with a crafted Symfony Mailer DSN string. - Why exploitation is possible: The endpoint:
- Does not perform authentication or installation-completion checks (CWE-306: Missing Authentication for Critical Function).
- Directly passes attacker-supplied DSN values into the mailer subsystem, which then initiates outbound SMTP connections (CWE-918: Server-Side Request Forgery).
Why this happens
The core issue is a lack of authentication and context checks on a network-reachable diagnostic endpoint combined with overly flexible, unvalidated configuration input.
The install.ajax.php script was designed to assist with installation and configuration, but unlike other AJAX endpoints, it omits the common bootstrap (global.inc.php) that normally enforces login and state conditions, leading to an unauthenticated critical function (CWE-306).
Within this unauthenticated context, the test_mailer action trusts a user-controlled Symfony Mailer DSN string, passing it directly to the mailer client.
This causes the server to initiate outbound SMTP connections to arbitrary hosts and ports supplied by the attacker, turning a configuration test into a generic SSRF primitive (CWE-918).
The combination of missing access control and unbounded network connectivity from the server-side mailer component creates a channel for internal network scanning, service interaction, and email relay abuse.
Potential impact
- Use of the Chamilo server as an open email relay for:
- Phishing campaigns
- Spam distribution
- Sending emails that appear to originate from the Chamilo server's IP or configured domains
- Server-Side Request Forgery into internal networks over SMTP, which may:
- Probe internal IP addresses and ports
- Interact with internal SMTP services or other mail-aware components
- Disclosure of internal network information via error messages, including:
- Hostnames and IP ranges
- Service availability and response patterns
- Reputational damage from the server's IP being blacklisted due to spam or abuse reports
- Potential stepping stone for more targeted attacks by mapping internal infrastructure and services reachable via SMTP.
General mitigation guidance
Effective mitigation generally requires hardening both access control and how diagnostic/configuration endpoints are designed:
- Enforce authentication and installation state checks:
- Ensure every AJAX endpoint and diagnostic script includes the common bootstrap or middleware that enforces authentication, authorization, and installation-completion checks.
- Treat installer and configuration utilities as sensitive surfaces, limiting their availability to trusted administrators only.
- Constrain network-capable configuration inputs:
- Avoid passing raw, user-controlled DSN strings or connection URIs directly into network clients.
- Validate DSN parameters against an allowlist of expected schemes, hosts, and ports, or restrict them to preconfigured profiles.
- Limit outbound network capabilities:
- Apply egress filtering at the network or container level so application servers can only connect to approved SMTP relays or mail gateways.
- Segment internal networks so that application servers do not have unnecessary visibility into sensitive internal services.
- Harden email functionality:
- Configure mailer components to use a fixed, trusted SMTP relay rather than arbitrary destinations derived from user input.
- Apply authentication, rate limiting, and abuse detection around any email-sending features to reduce the risk of relay misuse.
- Fail safely with minimal information disclosure:
- Normalize error handling so that connection failures and SMTP errors return generic messages to callers.
- Avoid echoing detailed connection errors, IP addresses, or internal hostnames back to the client.
How teams detect issues like this
Possible detection approaches focus on both code-level patterns and runtime behavior:
- Static analysis and code review:
- Flag PHP scripts or controllers that:
- Live in public or AJAX paths but do not include global bootstrap or authentication guards.
- Accept input that directly influences DSN strings, URLs, hostnames, or ports used by network clients.
- Look for diagnostic or installer endpoints callable without clear access-control checks.
- Add review checklists ensuring all AJAX endpoints pass through standard security middleware.
- Configuration and policy enforcement:
- Use CI/CD policies to prevent merging of new endpoints that bypass global initialization or security layers.
- Maintain a central registry of diagnostic/installation scripts and verify their access policies and exposure.
- Network and behavior monitoring:
- Monitor outbound SMTP connections from application servers for:
- Connections to unexpected destinations or ports
- Sudden spikes in email volume
- Patterns consistent with spam or phishing campaigns
- Inspect logs of the LMS for repeated access to installation or configuration endpoints from untrusted IP ranges.
- Automated tooling:
- Employ application security testing tools (DAST/IAST) to probe authenticated and unauthenticated endpoints for SSRF-like behavior.
- Use SAST tools with custom rules to detect user-controlled DSN or URL parameters feeding into mailer clients or generic network libraries.

