Vulnerabilities in pkg:npm/@portkey-ai/gateway

PACKAGE
Advisory Identifier: GHSA-hhh5-2cvx-vmfp
Advisory Summary

CVE-2025-66405 is a MODERATE server-side request forgery (ssrf) vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting @portkey ai/gateway libraries in the npm ecosystem. The issue involves server-side request forgery (ssrf) in custom host. Remediation is available by upgrading affected packages to version 1.14.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@portkey-ai/gateway

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@portkey-ai/gateway. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-hhh5-2cvx-vmfp CVE-2025-66405 MODERATE Portkey.ai Gateway: Server-Side Request Forgery (SSRF) in Custom Host

CVE-2025-66405 at a Glance

CVE Identifier CVE-2025-66405
GHSA Identifier GHSA-hhh5-2cvx-vmfp
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product @portkey ai/gateway
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-66405

To remediate this vulnerability, upgrade all affected @portkey ai/gateway dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@portkey-ai/gateway fixed: 1.14.0
npm install @portkey-ai/gateway@1.14.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @portkey-ai/gateway

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-66405, inspect your project dependencies using npm:

npm ls @portkey-ai/gateway

Analyze the terminal output to locate any version of @portkey ai/gateway in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.14.0), your application is affected.

Note: The npm ls @portkey-ai/gateway command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In @portkey ai/gateway, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary 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 ### 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. ### Patches 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. ### 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

CVE-2025-66405 Affected @portkey ai/gateway Versions

1 component(s)
Fixed Versions:
1.14.0
Product / Package Ecosystem Affected Versions Fixed Version
@portkey-ai/gateway
npm
< 1.14.0
1.14.0

References

Frequently Asked Questions

What is CVE-2025-66405?
CVE-2025-66405 is a security vulnerability in @portkey ai/gateway involving Server-Side Request Forgery (SSRF) in Custom Host under CWE-918: Server-Side Request Forgery (SSRF).
Which @portkey ai/gateway versions are affected?
Affected versions include releases prior to 1.14.0 across affected packages: @portkey-ai/gateway.
What version fixes CVE-2025-66405?
Upgrading to 1.14.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @portkey-ai/gateway affected?
Yes, @portkey-ai/gateway is affected in releases prior to 1.14.0. Upgrade your dependency to 1.14.0 or later.
What CWE is associated with CVE-2025-66405?
CVE-2025-66405 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check npm dependencies for CVE-2025-66405?
Run the dependency tree command: 'npm ls @portkey-ai/gateway'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hhh5-2cvx-vmfp",
  "modified" : "2025-12-02T01:08:38Z",
  "published" : "2025-12-02T01:08:37Z",
  "aliases" : [ "CVE-2025-66405" ],
  "summary" : "Portkey.ai Gateway: Server-Side Request Forgery (SSRF) in Custom Host",
  "details" : "### Summary\nThe 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\n\n### Impact\nThis 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.\n\n### Patches\nThe issue is patched in 1.14.0 (https://github.com/Portkey-AI/gateway/pull/1372)\n\nThe 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.\n\n**The fix (v1.14.0) implements a robust allow-list policy:**\n\n1. All custom host inputs are now strictly validated to ensure the resulting URI points only to trusted, expected external services.\n\n2. The implementation now explicitly blocks requests to non-routable IP addresses, loopback addresses, private networks and standard metadata endpoints.\n\n### Credit\nThis vulnerability was discovered and reported responsibly by @im-soohyun. We thank them for their adherence to coordinated vulnerability disclosure principles.\n\n### References\nhttps://cwe.mitre.org/data/definitions/918.html",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@portkey-ai/gateway"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.14.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Portkey-AI/gateway/security/advisories/GHSA-hhh5-2cvx-vmfp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-66405"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Portkey-AI/gateway/pull/1372"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Portkey-AI/gateway/commit/b5a7825ba5f4e6918deb32d9969899ce2229a885"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Portkey-AI/gateway"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-02T01:08:37Z",
    "nvd_published_at" : "2025-12-01T23:15:53Z"
  }
}