GHSA-5pmx-7r6r-wfqq: Github.com/kgateway dev/kgateway/v2 Kgateway Transformation Policy Template Can Vulnerability

MODERATE
CVSS 6.3
CWE-22
Published
Advisory Summary

GHSA-5pmx-7r6r-wfqq is a MODERATE (CVSS 6.3) kgateway transformation policy template can vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/kgateway dev/kgateway/v2 libraries in the Go ecosystem. The issue involves kgateway transformation policy template can emit files from the container. Remediation is available by upgrading affected packages to version 2.0.5, 2.1.0.

GHSA-5pmx-7r6r-wfqq at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-5pmx-7r6r-wfqq
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Github.com/kgateway dev/kgateway/v2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:H).

Attack Vector Adjacent (AV:A)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability High (A:H)

How to Fix GHSA-5pmx-7r6r-wfqq

To remediate this vulnerability, upgrade all affected Github.com/kgateway dev/kgateway/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/kgateway-dev/kgateway/v2 fixed: 2.0.5
Upgrade github.com/kgateway-dev/kgateway/v2 to 2.0.5
github.com/kgateway-dev/kgateway/v2 fixed: 2.1.0
Upgrade github.com/kgateway-dev/kgateway/v2 to 2.1.0
Verify Direct and Transitive Dependencies

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

inspect dependencies for github.com/kgateway-dev/kgateway/v2

How to Check if You Are Affected

To determine whether your application is affected by GHSA-5pmx-7r6r-wfqq, inspect your project dependencies for Github.com/kgateway dev/kgateway/v2:

inspect dependencies for github.com/kgateway-dev/kgateway/v2

Analyze the terminal output to locate any version of Github.com/kgateway dev/kgateway/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.5), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Github.com/kgateway dev/kgateway/v2, 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 transformation policy template feature in Kgateway versions through 2.0.4 allows users with TrafficPolicy creation permissions to craft transformations that read and expose arbitrary files from the dataplane container filesystem. ## Description ### Impact Users with permissions to create a TrafficPolicy can create a transformation that returns files from within the dataplane container. While no secrets are mounted to the container by default, users who mount custom volumes to the dataplane should be aware of potential data exposure through this vulnerability. This could allow unauthorized access to: - Configuration files within the container - Custom mounted volumes and their contents - Any files accessible to the dataplane container process Note: Updated availability score to high, as under some configurations this can prevent xDS updates. ### Patches Upgrade to version 2.0.5 or 2.1.0. These versions include an updated transformation filter in envoy-gloo that prevents file access through transformation templates. ### Workarounds If you are not using transformations, you can disallow TrafficPolicy creation or restrict transformation usage using a ValidatingAdmissionPolicy to prevent exploitation while preparing to upgrade. ## References - Fix in 2.1.0: https://github.com/kgateway-dev/kgateway/pull/12528 (envoy-gloo v1.35.2-patch4) - Backport to 2.0.5: Included in https://github.com/kgateway-dev/kgateway/pull/12535 (envoy-gloo v1.34.6-patch3) - Envoy-gloo releases: https://github.com/solo-io/envoy-gloo/releases/tag/v1.35.2-patch4 - Envoy-gloo releases: https://github.com/solo-io/envoy-gloo/releases/tag/v1.34.6-patch3 ## Credits Kindly reported by @rikatz ## For More Information If you have any questions or comments about this advisory, please reach out in slack https://cloud-native.slack.com/archives/C080D3PJMS4

GHSA-5pmx-7r6r-wfqq Affected Github.com/kgateway dev/kgateway/v2 Versions

2 component(s)
Fixed Versions:
2.0.52.1.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/kgateway-dev/kgateway/v2
Go
< 2.0.5
2.0.5
github.com/kgateway-dev/kgateway/v2
Go
≥ 2.1.0-agw-cel-rbac
< 2.1.0
2.1.0

References

Frequently Asked Questions

What is GHSA-5pmx-7r6r-wfqq?
GHSA-5pmx-7r6r-wfqq is a security vulnerability in Github.com/kgateway dev/kgateway/v2 involving Kgateway transformation policy template can emit files from the container under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Github.com/kgateway dev/kgateway/v2 versions are affected?
Affected versions include releases prior to 2.0.5, 2.1.0 across affected packages: github.com/kgateway-dev/kgateway/v2.
What version fixes GHSA-5pmx-7r6r-wfqq?
Upgrading to 2.0.5, 2.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/kgateway-dev/kgateway/v2 affected?
Yes, github.com/kgateway-dev/kgateway/v2 is affected in releases prior to 2.0.5, 2.1.0. Upgrade your dependency to 2.0.5, 2.1.0 or later.
What is the CVSS score of GHSA-5pmx-7r6r-wfqq?
GHSA-5pmx-7r6r-wfqq has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:H.
What CWE is associated with GHSA-5pmx-7r6r-wfqq?
GHSA-5pmx-7r6r-wfqq is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Go dependencies for GHSA-5pmx-7r6r-wfqq?
Run the dependency tree command: 'inspect dependencies for github.com/kgateway-dev/kgateway/v2'. 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-5pmx-7r6r-wfqq",
  "modified" : "2025-11-17T21:37:07Z",
  "published" : "2025-11-04T18:58:22Z",
  "aliases" : [ ],
  "summary" : "Kgateway transformation policy template can emit files from the container ",
  "details" : "## Summary\n\nThe transformation policy template feature in Kgateway versions through 2.0.4 allows users with TrafficPolicy creation permissions to craft transformations that read and expose arbitrary files from the dataplane container filesystem.\n\n## Description\n\n### Impact\n\nUsers with permissions to create a TrafficPolicy can create a transformation that returns files from within the dataplane container. While no secrets are mounted to the container by default, users who mount custom volumes to the dataplane should be aware of potential data exposure through this vulnerability.\n\nThis could allow unauthorized access to:\n- Configuration files within the container\n- Custom mounted volumes and their contents\n- Any files accessible to the dataplane container process\n\nNote: Updated availability score to high, as under some configurations this can prevent xDS updates.\n\n### Patches\n\nUpgrade to version 2.0.5 or 2.1.0. These versions include an updated transformation filter in envoy-gloo that prevents file access through transformation templates.\n\n### Workarounds\n\nIf you are not using transformations, you can disallow TrafficPolicy creation or restrict transformation usage using a ValidatingAdmissionPolicy to prevent exploitation while preparing to upgrade.\n\n## References\n\n- Fix in 2.1.0: https://github.com/kgateway-dev/kgateway/pull/12528 (envoy-gloo v1.35.2-patch4)\n- Backport to 2.0.5: Included in https://github.com/kgateway-dev/kgateway/pull/12535 (envoy-gloo v1.34.6-patch3)\n- Envoy-gloo releases: https://github.com/solo-io/envoy-gloo/releases/tag/v1.35.2-patch4\n- Envoy-gloo releases: https://github.com/solo-io/envoy-gloo/releases/tag/v1.34.6-patch3\n\n\n## Credits\n\nKindly reported by @rikatz\n\n## For More Information\n\nIf you have any questions or comments about this advisory, please reach out in slack https://cloud-native.slack.com/archives/C080D3PJMS4",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/kgateway-dev/kgateway/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/kgateway-dev/kgateway/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0-agw-cel-rbac"
      }, {
        "fixed" : "2.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kgateway-dev/kgateway/security/advisories/GHSA-5pmx-7r6r-wfqq"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kgateway-dev/kgateway/pull/12528"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kgateway-dev/kgateway/pull/12535"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kgateway-dev/kgateway"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/solo-io/envoy-gloo/releases/tag/v1.34.6-patch3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/solo-io/envoy-gloo/releases/tag/v1.35.2-patch4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-11-04T18:58:22Z",
    "nvd_published_at" : null
  }
}