CVE-2025-66405

CVE-2025-66405 is a medium-severity server-side request forgery (SSRF) vulnerability in @portkey-ai/gateway (npm), affecting versions < 1.14.0. It is fixed in 1.14.0.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Portkey.ai Gateway: Server-Side Request Forgery (SSRF) in Custom Host

The gateway determines the destination baseURL by prioritizing the value in the x-portkey-custom-host request header. The proxy route then appends the client-specified path to perform an external fetch. This can be maliciously used by users for SSRF (CWE-918) attack

Credit

This vulnerability was discovered and reported responsibly by @im-soohyun. We thank them for their adherence to coordinated vulnerability disclosure principles.

References

https://cwe.mitre.org/data/definitions/918.html

Impact

This vulnerability can be exploited to force the server to make requests to arbitrary hosts on the internal network. This could allow an attacker to exfiltrate sensitive data, for instance, by accessing the AWS metadata service.

Untrusted input controls the target URL of a server-initiated request, which may reach internal services not otherwise accessible from outside. Typical impact: access to internal metadata services, internal APIs, or cloud credentials.

Affected versions

@portkey-ai/gateway (< 1.14.0)

Security releases

@portkey-ai/gateway → 1.14.0 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

The issue is patched in 1.14.0 (https://github.com/Portkey-AI/gateway/pull/1372)

The vulnerability resides within the gateway's request processing function which handles the x-portkey-custom-host header. This parameter was passed directly or with insufficient validation/sanitization to an internal HTTP request function.

The fix (v1.14.0) implements a robust allow-list policy:

  1. All custom host inputs are now strictly validated to ensure the resulting URI points only to trusted, expected external services.

  2. The implementation now explicitly blocks requests to non-routable IP addresses, loopback addresses, private networks and standard metadata endpoints.

Frequently Asked Questions

  1. What is CVE-2025-66405? CVE-2025-66405 is a medium-severity server-side request forgery (SSRF) vulnerability in @portkey-ai/gateway (npm), affecting versions < 1.14.0. It is fixed in 1.14.0. Untrusted input controls the target URL of a server-initiated request, which may reach internal services not otherwise accessible from outside.
  2. Which versions of @portkey-ai/gateway are affected by CVE-2025-66405? @portkey-ai/gateway (npm) versions < 1.14.0 is affected.
  3. Is there a fix for CVE-2025-66405? Yes. CVE-2025-66405 is fixed in 1.14.0. Upgrade to this version or later.
  4. Is CVE-2025-66405 exploitable, and should I be worried? Whether CVE-2025-66405 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether CVE-2025-66405 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix CVE-2025-66405? Upgrade @portkey-ai/gateway to 1.14.0 or later.

Stop the waste.
Protect your environment with Kodem.