Summary
CraftQL versions 1.3.7 and earlier contain a Server-Side Request Forgery (SSRF) flaw in the asset field schema handling logic, allowing attackers to coerce the server into making arbitrary outbound HTTP requests.
In vulnerable deployments, a crafted GraphQL request can abuse backend URL handling to reach internal services and, in some environments, pivot to arbitrary code execution via exposed admin, metadata, or cloud instance endpoints.
Affected context
The vulnerability manifests in CraftQL's processing of asset-related GraphQL queries, specifically within vendor/markhuot/craftql/src/Listeners/GetAssetsFieldSchema.php.
It is relevant where:
- CraftQL is installed and enabled in a Craft CMS instance
- Asset field schemas or related metadata cause the server to resolve or fetch remote resources based on user-controllable input
- The Craft CMS server can reach internal network services, cloud metadata endpoints, or management interfaces from its network location
Environments with flat or overly permissive internal network access are more exposed to high-impact consequences.
Exploit preconditions
- Attack surface: Publicly exposed Craft CMS / CraftQL endpoint receiving user-supplied GraphQL queries.
- Required access: Ability to send crafted GraphQL requests to the application (typically over HTTP/HTTPS; may or may not require authentication depending on configuration).
- Trigger point: Execution of GraphQL operations that cause
GetAssetsFieldSchemalogic to resolve or fetch URLs derived from attacker-controlled data. - Why exploitation is possible: The server-side logic trusts user-controlled URL or location parameters for asset schema handling and forwards HTTP requests without sufficient validation, restriction, or segmentation, enabling SSRF to arbitrary or internal targets.
Why this happens
This issue is an instance of CWE-918: Server-Side Request Forgery, where user input influences server-initiated HTTP requests.
The vulnerable pattern arises when asset field schema resolution uses unvalidated or insufficiently constrained URLs or resource identifiers, allowing users to steer outbound requests to destinations of their choosing.
Because the code runs on the server, it inherits the server's network reach, making internal or otherwise non-public services accessible through the SSRF primitive.
The lack of strict allowlists, host/port filters, or scheme validation around these outbound requests enables abuse beyond the originally intended use cases.
Potential impact
- Discovery and interaction with internal-only HTTP services that are not directly exposed to the internet
- Access to cloud provider or container metadata endpoints that can lead to credential theft or environment takeover
- Interaction with internal admin panels, CI/CD services, or configuration endpoints that may allow arbitrary command or code execution
- Use of the application server as a proxy to bypass network segmentation and firewall rules
- Potential data exfiltration from internal APIs reachable from the Craft CMS host
General mitigation guidance
Effective mitigation focuses on strict control of server-initiated HTTP requests and reduction of trust in user-provided URLs.
Common defensive patterns include:
- Introducing allowlists for outbound destinations, limiting requests to a small set of known-good hosts or domains
- Enforcing scheme, port, and IP validation, e.g., blocking requests to internal IP ranges, localhost, and non-HTTP(S) protocols
- Normalizing and re-resolving hostnames server-side and re-checking that resolved IPs stay within allowed ranges
- Avoiding dynamic URL fetching in schema resolution or design-time operations and instead relying on static configuration where possible
- Running the application with network egress controls, such as firewalls or service meshes that restrict outbound connectivity
- Applying least privilege networking by placing application servers in segments that cannot directly reach sensitive management or metadata endpoints
How teams detect issues like this
Detection can combine static review, dynamic testing, and runtime monitoring:
- Static analysis / code review:
- Flag code paths that perform HTTP requests based on request parameters, GraphQL arguments, or other user input, especially in
GetAssetsFieldSchemaand similar listeners - Look for direct use of HTTP client libraries where URL or host is not constrained (no allowlist or IP-range checks)
- Review any logic that derives hostnames, protocols, or ports from untrusted data
- Dynamic application security testing (DAST):
- Use SSRF-focused tests that supply URLs pointing to controlled callback endpoints to observe outbound requests
- Include payloads that reference internal hostnames (e.g.,
localhost,127.0.0.1, metadata IPs) to confirm they are blocked - Runtime / operational monitoring:
- Monitor egress logs from the application server for unusual destinations or spikes in outbound requests
- Apply network policies that log or deny access to sensitive internal ranges from web application subnets
- Automated security scanners and SAST tools can help identify common SSRF patterns, but manual review is often necessary to confirm business logic risks.

