Summary
LimeSurvey's REST API survey template endpoint contains a server-side request forgery vulnerability that lets authenticated users steer the application server to make arbitrary outbound HTTP requests by manipulating the Host header.
When the getTemplateData() function trusts the incoming Host header, an attacker can pivot requests toward internal services and cloud metadata endpoints, potentially exposing sensitive credentials such as IAM tokens.
Affected context
The vulnerability occurs in LimeSurvey deployments that expose the REST API survey template endpoint and process HTTP Host headers without strict validation or normalization.
It is most relevant in environments where:
- The application server has network access to internal services or cloud provider metadata endpoints
- API calls are allowed from authenticated but untrusted or semi-trusted users
- Outbound requests are constructed using user-controllable header values such as Host
Exploit preconditions
- Attack surface: LimeSurvey REST API survey template endpoint
- Required access: Authenticated user access to the API capable of sending crafted HTTP requests
- Trigger point: Invocation of the getTemplateData() function with a manipulated Host header
- Why exploitation is possible: The application uses the Host header directly in building outbound requests without sanitization, canonicalization, or restriction, enabling redirection of server-side HTTP traffic to attacker-chosen destinations.
Why this happens
The core issue is untrusted input from the HTTP Host header being used to influence server-side HTTP requests.
In the getTemplateData() function, the Host header is treated as trustworthy and incorporated into logic that constructs outbound calls or resource locations, aligning with CWE-918 (Server-Side Request Forgery).
This insecure pattern allows attackers to turn the application into a proxy, making it fetch data from internal or sensitive endpoints that the attacker could not reach directly.
Potential impact
- Access to internal HTTP-based services that are otherwise not exposed publicly
- Retrieval of cloud instance metadata, including IAM tokens or other secrets
- Discovery of internal network topology and service endpoints
- Use of the application server as a pivot point for further attacks against backend systems
- Potential escalation of privileges using harvested credentials
General mitigation guidance
Effective mitigation focuses on limiting how user-controllable headers influence server-side network behavior.
Common defensive patterns include:
- Avoiding direct use of the Host header or other client-supplied headers to construct internal URLs or outbound requests
- Implementing strict allowlists for outbound destinations, limiting calls to known, vetted hosts
- Normalizing and validating incoming headers, discarding or overriding Host values that do not match expected server configuration
- Segmenting network access so application servers cannot reach highly sensitive endpoints such as cloud metadata services
- Applying least-privilege principles to instance and service roles so compromised credentials yield minimal access
How teams detect issues like this
Organizations can detect SSRF patterns by:
- Using static analysis to flag code paths where request headers or URL components derived from user input are used in outbound HTTP calls
- Reviewing API endpoints that issue server-side HTTP requests, especially where Host or URL parameters are incorporated without validation
- Establishing logging around outbound requests and monitoring for unusual destinations, especially internal IP ranges or metadata endpoints
- Applying security policies in CI/CD to prevent introduction of new SSRF sinks, backed by automated scanners or linters focused on network request construction

