Listen to this Post
The vulnerability operates through the `x-portkey-custom-host` HTTP header within the Portkey AI Gateway. During request processing, the gateway prioritizes this header’s value to determine the baseURL for proxy destinations. This baseURL is then combined with the client-provided path from the request to perform an external fetch. Without proper validation, the header value is passed directly to the internal HTTP client function. An attacker can craft a request setting this header to an arbitrary host, such as an internal IP address or cloud metadata endpoint. The gateway, trusting this input, will forward the request to the specified host. This allows the attacker to induce the server to make requests to internal network resources it can access, like databases or metadata services. The lack of validation for private IP ranges, loopback addresses, and non-routable networks enables Server-Side Request Forgery. Specifically, by setting the header to `http://169.254.169.254`, an attacker could access the AWS instance metadata service. The vulnerability stems from insufficient sanitization where the header value was not checked against an allow-list before fetching. The proxy mechanism inadvertently trusts user-controlled input for network calls. This design flaw permits scanning and interacting with internal infrastructure. The fix involves implementing strict host validation to prevent such unauthorized redirections.
Platform: Portkey AI Gateway
Version: Before 1.14.0
Vulnerability: Header-based SSRF
Severity: Critical
date: Unspecified
Prediction: Patch 1.14.0
What Undercode Say:
Analytics
SSRF risk high
Internal network exposure
Metadata service target
Showing bash commands and codes related to the blog
curl -X GET \
-H “x-portkey-custom-host: http://169.254.169.254” \
http://gateway.example.com/api/proxy
Exploits header vulnerability
Fetches AWS metadata
how Exploit:
Send malicious header
Target internal IPs
Exfiltrate sensitive data
Protection from this CVE
Update to 1.14.0
Implement allow-list validation
Block private networks
Impact:
Internal network access
Data exfiltration possible
Metadata compromise risk
🎯Let’s Practice Exploiting & Learn Patching For Free:
Sources:
Reported By: github.com
Extra Source Hub:
Undercode

