CVE-2025-66405: SSRF Vulnerability in @portkey-ai/gateway Package
Summary
CVE-2025-66405: Portkey.ai Gateway: Server-Side Request Forgery (SSRF) in Custom Host. Affects @portkey-ai/gateway versions < 1.14.0. Fixed in 1.14.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The @portkey-ai/gateway package is a tool designed to facilitate secure and efficient communication between clients and external services. It acts as a proxy, allowing users to specify custom hosts for requests. However, this flexibility can lead to security vulnerabilities if not properly managed, particularly in the context of Server-Side Request Forgery (SSRF) attacks.
Vulnerability Detail
The vulnerability arises from the gateway's handling of the x-portkey-custom-host request header, which is used to determine the destination baseURL. Insufficient validation of this header allows attackers to manipulate it, potentially forcing the server to make requests to arbitrary internal hosts. This can lead to unauthorized access to sensitive data, such as AWS metadata, and poses a significant risk to the integrity and confidentiality of the system.
How To Fix
Minimum fixed version
1.14.0
This is the first release that contains the fix.
npm install @portkey-ai/gateway@1.14.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can avoid using the x-portkey-custom-host header until the package is updated. Additionally, ensure that your application has strict input validation and sanitization mechanisms in place to mitigate the risk of SSRF attacks.
Conclusion
The CVE-2025-66405 vulnerability in the @portkey-ai/gateway package poses a significant risk due to its potential for SSRF attacks. It is crucial to update to the patched version 1.14.0 to mitigate this risk and ensure the security of your application.
See every vulnerability recorded for @portkey-ai/gateway →
FAQ
Server-Side Request Forgery (SSRF) is a vulnerability that allows an attacker to send crafted requests from a vulnerable server to internal or external resources.
An attacker can exploit this vulnerability by manipulating the x-portkey-custom-host header to make the server send requests to internal services, potentially accessing sensitive data.
The impacts include unauthorized access to sensitive data, exposure of internal services, and potential data exfiltration.
Yes, the vulnerability is patched in version 1.14.0 of the @portkey-ai/gateway package.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Check your application against this vulnerability using the Vulert playground at Vulert Scanner without needing to sign up.