GHSA-gg4x-fgg2-h9w9: Github.com/kyverno/kyverno Bypassing Kyverno Policies Vulnerability

CRITICAL
CVSS 9.0
CWE-284
Published
Advisory Summary

GHSA-gg4x-fgg2-h9w9 is a CRITICAL (CVSS 9.0) bypassing kyverno policies vulnerability (CWE-284: Improper Access Control) affecting Github.com/kyverno/kyverno libraries in the Go ecosystem. The issue involves bypassing kyverno policies via double policy exceptions. Remediation is available by upgrading affected packages to version 1.13.0.

GHSA-gg4x-fgg2-h9w9 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-gg4x-fgg2-h9w9
Severity CRITICAL
CVSS v3.1 Base Score 9.0
CWE Classification CWE-284: Improper Access Control
Affected Product Github.com/kyverno/kyverno
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.0

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:C/C:H/I:H/A:H).

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

How to Fix GHSA-gg4x-fgg2-h9w9

To remediate this vulnerability, upgrade all affected Github.com/kyverno/kyverno 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/kyverno/kyverno fixed: 1.13.0
Upgrade github.com/kyverno/kyverno to 1.13.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/kyverno/kyverno

How to Check if You Are Affected

To determine whether your application is affected by GHSA-gg4x-fgg2-h9w9, inspect your project dependencies for Github.com/kyverno/kyverno:

inspect dependencies for github.com/kyverno/kyverno

Analyze the terminal output to locate any version of Github.com/kyverno/kyverno in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.13.0), 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-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Github.com/kyverno/kyverno, 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 If a cluster has a `Kyverno` policy in enforce mode and there are two exceptions, this allows the policy to be bypassed, even if the first exception is more restrictive than the second. ### Details The following policy was applied: ```yaml apiVersion: kyverno.io/v1 kind: ClusterPolicy metadata: name: disallow-host-path annotations: policies.kyverno.io/title: Disallow hostPath policies.kyverno.io/category: Pod Security Standards (Baseline) policies.kyverno.io/severity: medium policies.kyverno.io/subject: Pod,Volume kyverno.io/kyverno-version: 1.6.0 kyverno.io/kubernetes-version: "1.22-1.23" policies.kyverno.io/description: >- HostPath volumes let Pods use host directories and volumes in containers. Using host resources can be used to access shared data or escalate privileges and should not be allowed. This policy ensures no hostPath volumes are in use. spec: validationFailureAction: Enforce background: true rules: - name: host-path match: any: - resources: kinds: - Pod validate: message: >- HostPath volumes are forbidden. The field spec.volumes[*].hostPath must be unset. pattern: spec: =(volumes): - X(hostPath): "null" ``` And two exceptions: ```yaml apiVersion: kyverno.io/v2beta1 kind: PolicyException metadata: name: disallow-host-path-exception namespace: kyverno spec: exceptions: - policyName: disallow-host-path ruleNames: - host-path match: any: - resources: kinds: - DaemonSet - Deployment - Job - StatefulSet - ReplicaSet - ReplicationController - Pod - CronJob namespaces: - luntry - tstkyverno - examplens ``` ```yaml apiVersion: kyverno.io/v2beta1 kind: PolicyException metadata: name: disallow-host-path-exception-names namespace: kyverno spec: exceptions: - policyName: disallow-host-path ruleNames: - host-path match: any: - resources: kinds: - DaemonSet - Deployment - Job - StatefulSet - ReplicaSet - ReplicationController - Pod - CronJob names: - '*haproxy*' - '*ingress*' ``` Trying to apply such a yaml will result in the expected ban: ```yaml apiVersion: v1 kind: Pod metadata: name: mtkpi labels: app: pentest spec: containers: - name: mtkpi image: ubuntu volumeMounts: - mountPath: /host name: noderoot command: [ "/bin/sh", "-c", "--" ] args: [ "while true; do sleep 30; done;" ] volumes: - name: noderoot hostPath: path: / ``` <img width="855" height="483" alt="Снимок экрана 2025-09-04 в 13 35 46" src="https://github.com/user-attachments/assets/deb28128-52fb-4f5f-a9bd-b68eefd411b2" /> However, if the load name is changed to satisfy the second exception, the restrictions can be bypassed: ```yaml apiVersion: v1 kind: Pod metadata: name: ingress labels: app: pentest spec: containers: - name: mtkpi image: ubuntu volumeMounts: - mountPath: /host name: noderoot command: [ "/bin/sh", "-c", "--" ] args: [ "while true; do sleep 30; done;" ] volumes: - name: noderoot hostPath: path: / ``` <img width="449" height="386" alt="Снимок экрана 2025-09-04 в 13 37 09" src="https://github.com/user-attachments/assets/8d5ad1e2-6d16-4768-8741-f11363bb9b22" /> It turns out that the second exception is higher in priority for Kyverno and allows for bypass of the restrictions. ### Impact The security restrictions can be bypassed.

GHSA-gg4x-fgg2-h9w9 Affected Github.com/kyverno/kyverno Versions

1 component(s)
Fixed Versions:
1.13.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/kyverno/kyverno
Go
≥ 1.9.0
< 1.13.0
1.13.0

References

Frequently Asked Questions

What is GHSA-gg4x-fgg2-h9w9?
GHSA-gg4x-fgg2-h9w9 is a security vulnerability in Github.com/kyverno/kyverno involving Bypassing Kyverno Policies via Double Policy Exceptions under CWE-284: Improper Access Control.
Which Github.com/kyverno/kyverno versions are affected?
Affected versions include releases prior to 1.13.0 across affected packages: github.com/kyverno/kyverno.
What version fixes GHSA-gg4x-fgg2-h9w9?
Upgrading to 1.13.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/kyverno/kyverno affected?
Yes, github.com/kyverno/kyverno is affected in releases prior to 1.13.0. Upgrade your dependency to 1.13.0 or later.
What is the CVSS score of GHSA-gg4x-fgg2-h9w9?
GHSA-gg4x-fgg2-h9w9 has a CVSS v3.1 base score of 9.0 (CRITICAL) with vector string CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with GHSA-gg4x-fgg2-h9w9?
GHSA-gg4x-fgg2-h9w9 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check Go dependencies for GHSA-gg4x-fgg2-h9w9?
Run the dependency tree command: 'inspect dependencies for github.com/kyverno/kyverno'. 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-gg4x-fgg2-h9w9",
  "modified" : "2026-01-06T18:00:16Z",
  "published" : "2026-01-06T18:00:16Z",
  "aliases" : [ ],
  "summary" : "Bypassing Kyverno Policies via Double Policy Exceptions",
  "details" : "### Summary\nIf a cluster has a `Kyverno` policy in enforce mode and there are two exceptions, this allows the policy to be bypassed, even if the first exception is more restrictive than the second.\n\n### Details\n\nThe following policy was applied:\n\n```yaml\napiVersion: kyverno.io/v1\nkind: ClusterPolicy\nmetadata:\n  name: disallow-host-path\n  annotations:\n    policies.kyverno.io/title: Disallow hostPath\n    policies.kyverno.io/category: Pod Security Standards (Baseline)\n    policies.kyverno.io/severity: medium\n    policies.kyverno.io/subject: Pod,Volume\n    kyverno.io/kyverno-version: 1.6.0\n    kyverno.io/kubernetes-version: \"1.22-1.23\"\n    policies.kyverno.io/description: >-\n      HostPath volumes let Pods use host directories and volumes in containers.\n      Using host resources can be used to access shared data or escalate privileges\n      and should not be allowed. This policy ensures no hostPath volumes are in use.\nspec:\n  validationFailureAction: Enforce\n  background: true\n  rules:\n    - name: host-path\n      match:\n        any:\n        - resources:\n            kinds:\n              - Pod\n      validate:\n        message: >-\n          HostPath volumes are forbidden. The field spec.volumes[*].hostPath must be unset.\n        pattern:\n          spec:\n            =(volumes):\n              - X(hostPath): \"null\"\n```\n\nAnd two exceptions:\n\n```yaml\napiVersion: kyverno.io/v2beta1\nkind: PolicyException\nmetadata:\n  name: disallow-host-path-exception\n  namespace: kyverno\nspec:\n  exceptions:\n  - policyName: disallow-host-path\n    ruleNames:\n    - host-path\n  match:\n    any:\n    - resources:\n        kinds:\n        - DaemonSet\n        - Deployment\n        - Job\n        - StatefulSet\n        - ReplicaSet\n        - ReplicationController\n        - Pod\n        - CronJob\n        namespaces:\n        - luntry\n        - tstkyverno\n        - examplens\n```\n```yaml\napiVersion: kyverno.io/v2beta1\nkind: PolicyException\nmetadata:\n  name: disallow-host-path-exception-names\n  namespace: kyverno\nspec:\n  exceptions:\n  - policyName: disallow-host-path\n    ruleNames:\n    - host-path\n  match:\n    any:\n    - resources:\n        kinds:\n        - DaemonSet\n        - Deployment\n        - Job\n        - StatefulSet\n        - ReplicaSet\n        - ReplicationController\n        - Pod\n        - CronJob\n        names:\n        - '*haproxy*'\n        - '*ingress*'\n```\nTrying to apply such a yaml will result in the expected ban:\n\n```yaml\napiVersion: v1\nkind: Pod\nmetadata:\n  name: mtkpi\n  labels:\n    app: pentest\nspec:\n  containers:\n  - name: mtkpi\n    image: ubuntu\n    volumeMounts:\n    - mountPath: /host\n      name: noderoot\n    command: [ \"/bin/sh\", \"-c\", \"--\" ]\n    args: [ \"while true; do sleep 30; done;\" ]  \n  volumes:\n  - name: noderoot\n    hostPath:\n      path: /\n```\n<img width=\"855\" height=\"483\" alt=\"Снимок экрана 2025-09-04 в 13 35 46\" src=\"https://github.com/user-attachments/assets/deb28128-52fb-4f5f-a9bd-b68eefd411b2\" />\n\nHowever, if the load name is changed to satisfy the second exception, the restrictions can be bypassed:\n\n```yaml\napiVersion: v1\nkind: Pod\nmetadata:\n  name: ingress\n  labels:\n    app: pentest\nspec:\n  containers:\n  - name: mtkpi\n    image: ubuntu\n    volumeMounts:\n    - mountPath: /host\n      name: noderoot\n    command: [ \"/bin/sh\", \"-c\", \"--\" ]\n    args: [ \"while true; do sleep 30; done;\" ]  \n  volumes:\n  - name: noderoot\n    hostPath:\n      path: /\n```\n\n<img width=\"449\" height=\"386\" alt=\"Снимок экрана 2025-09-04 в 13 37 09\" src=\"https://github.com/user-attachments/assets/8d5ad1e2-6d16-4768-8741-f11363bb9b22\" />\n\nIt turns out that the second exception is higher in priority for Kyverno and allows for bypass of the restrictions.\n\n### Impact\nThe security restrictions can be bypassed.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/kyverno/kyverno"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.9.0"
      }, {
        "fixed" : "1.13.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.12.7"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kyverno/kyverno/security/advisories/GHSA-gg4x-fgg2-h9w9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kyverno/kyverno"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-06T18:00:16Z",
    "nvd_published_at" : null
  }
}