Skip to content

K8s Plugin: sanitize kubeconfig values from guest before merging with host kubeconfig - #2310

Merged
katiewasnothere merged 1 commit into
apple:mainfrom
katiewasnothere:sanitize_k8s_guest_config
Sep 28, 2026
Merged

katiewasnothere merged 1 commit into
apple:mainfrom
katiewasnothere:sanitize_k8s_guest_config

Conversation

@katiewasnothere

Copy link
Copy Markdown
Contributor

Motivation and Context

Prevent container-controlled kubeconfig from enabling arbitrary command execution on the host. This additionally adds a new guard that the kubeconfig in the guest only has a single entry for each of clusters, users, and contexts. Previously if there were multiple of these, the code would rewrite the names for each to be containerID so we'd be quietly corrupting the kubeconfig.

Testing

  • Tested locally
  • Added/updated tests

… host kubeconfig

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
@github-actions

Copy link
Copy Markdown

Code Coverage

Tier Line Coverage
Unit 25.26%
Integration 66.77%
Combined 76.25%

@katiewasnothere
katiewasnothere merged commit 31a069a into apple:main Sep 28, 2026
4 checks passed
@katiewasnothere
katiewasnothere deleted the sanitize_k8s_guest_config branch September 28, 2026 21:47
@shellbet

Copy link
Copy Markdown

Hi Container team,

Thank you for the fix and for publishing the advisory.
I noticed that GHSA-44v5-vx46-ghv6 is now public, but the advisory currently shows “No known CVE” under the CVE ID field.
Could you please request a CVE ID for this vulnerability?
Thank you again for the collaboration and the reporter credit.

Best regards,
Mehmet Barış Üresin

devops-thiago added a commit to devops-thiago/container that referenced this pull request Oct 9, 2026
…kubeconfig (#53)

* K8s Plugin: sanitize kubeconfig values from guest before merging with host kubeconfig (apple#2310)

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
(cherry picked from commit 31a069a)

* fix(build): declare ContainerNetworkClient's dependency on ContainerVersion

NetworkClient.swift imports ContainerVersion for ServiceIdentity.machPrefix, but the
target did not declare it. The Swift 6.4 build links each test product strictly and
ContainerNetworkServerTests failed with an undefined machPrefix symbol.

---------

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
Co-authored-by: Kathryn Baldauf <k_baldauf@apple.com>
@shellbet

This comment was marked as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants