Summary
LibreChat versions up to 0.8.1-rc2 allow server-side request forgery (SSRF) through the Actions feature, which lets user-defined agents call arbitrary remote services based on OpenAPI specifications.
Because the default configuration does not restrict where these actions can connect, an attacker can abuse agent actions to reach internal services such as the bundled RAG API or other network-accessible components.
Affected context
This vulnerability manifests in LibreChat deployments where:
- The Actions feature is enabled for agents
- Agents can be configured by users with arbitrary OpenAPI specifications or endpoints
- The LibreChat server has network-level access to internal services (e.g., RAG API in the default Docker Compose, other microservices, databases, or metadata APIs)
- No network-level or application-level restrictions are in place to limit outbound HTTP(S) destinations for actions
In such environments, the LibreChat backend effectively acts as an HTTP client on behalf of users, and without restrictions, can be steered toward internal-only endpoints.
Exploit preconditions
- Attack surface: Agent configuration interface and any workflow that allows defining or editing Actions (OpenAPI-based remote integrations).
- Required access: Ability to create or modify an agent's Actions configuration (which may be available to regular or unprivileged users depending on deployment settings).
- Trigger point: Execution of an agent action that performs an HTTP request to an attacker-controlled or internal endpoint, using the LibreChat server's network position.
- Why exploitation is possible: The system does not enforce allowlists, blocklists, or network segmentation for action targets. User-supplied OpenAPI specs and endpoints are treated as trusted, allowing requests to internal addresses and services reachable only from the LibreChat server's network.
Why this happens
The underlying issue is a missing trust boundary between user-controlled configuration and server-side HTTP clients.
LibreChat's Actions feature lets users define OpenAPI specifications that the backend will call as part of agent execution, but the implementation assumes those targets are benign and externally scoped.
This design creates a classic CWE-918: Server-Side Request Forgery (SSRF) scenario: user-influenced URLs are fetched by a privileged server component with broader network visibility.
Without hostname/IP validation, network zoning, or protocol/port restrictions, attackers can pivot through LibreChat to interact with internal services that are not directly exposed to them.
Potential impact
- Unauthorized access to internal HTTP services (e.g., the bundled RAG API, internal APIs, or admin panels)
- Exposure of sensitive configuration data or metadata from internal services
- Modification or poisoning of internal data sources (such as RAG knowledge bases or internal APIs that accept writes)
- Use of the LibreChat backend as a pivot point for further network reconnaissance and lateral movement
- Potential bypass of IP-based access controls and firewall rules that assume the server is trusted
- Indirect assistance in exploiting other internal vulnerabilities reachable only from the server's network
General mitigation guidance
Effective mitigation revolves around restricting where server-initiated HTTP requests can go and reducing trust in user-configured endpoints.
Non-version-specific hardening patterns include:
- Network egress controls: Place LibreChat in a network zone where outbound traffic is tightly filtered. Apply firewall or proxy rules so the application cannot reach internal-only IP ranges or sensitive infrastructure from its HTTP client.
- Endpoint allowlisting: Introduce configuration options to define explicit allowlists of domains or services that Actions may contact. Block RFC1918 and link-local address ranges unless explicitly needed.
- Validation of user-supplied URLs/specifications: Implement server-side validation that rejects OpenAPI specs pointing to private IPs, localhost, or internal hostnames, and enforces HTTPS where possible.
- Scoped agent capabilities: Provide role-based controls so only trusted users can create or modify agents with Actions, particularly those that can add arbitrary endpoints or headers.
- Segregation of internal APIs: Host sensitive internal components (like RAG APIs or admin interfaces) in separate networks, or expose them only behind additional authentication layers independent of LibreChat.
- Principle of least privilege for backend services: Limit what internal services can do or access on behalf of LibreChat, so even if SSRF is abused, downstream impact is minimized.
How teams detect issues like this
Organizations can detect or monitor for SSRF-like behavior in several ways:
- Application-layer logging and alerting: Log all agent action requests with full URLs, resolved hostnames, and response codes. Flag requests targeting private IP ranges, localhost, or unexpected internal domains.
- Network monitoring: Use IDS/IPS or flow monitoring to detect unusual outbound traffic patterns from the LibreChat host, especially to internal ranges not normally accessed.
- Static and configuration analysis: Review code paths where user-controlled data influences HTTP clients, focusing on the Actions implementation and OpenAPI handling logic. Static analysis rules can highlight dynamic URL construction or lack of destination validation.
- Security-focused code review: During changes to agent or integration features, reviewers should explicitly check for URL validation, host filtering, and network boundary assumptions.
- Automated policy enforcement: Integrate security scanners or policy-as-code tools in CI to ensure configuration files and infrastructure definitions enforce egress controls and do not inadvertently expose internal services to application-level SSRF.

