Skip to content

[release/2.0] fix: sanitize error before gRPC return to prevent credential leak in pod events#13180

Closed
k8s-infra-cherrypick-robot wants to merge 1 commit intocontainerd:release/2.0from
k8s-infra-cherrypick-robot:cherry-pick-12801-to-release/2.0
Closed

[release/2.0] fix: sanitize error before gRPC return to prevent credential leak in pod events#13180
k8s-infra-cherrypick-robot wants to merge 1 commit intocontainerd:release/2.0from
k8s-infra-cherrypick-robot:cherry-pick-12801-to-release/2.0

Conversation

@k8s-infra-cherrypick-robot
Copy link
Copy Markdown

This is an automated cherry-pick of #12801

/assign chrishenzie

…pod events

PR containerd#12491 fixed credential leaks in containerd logs but the gRPC error
returned to kubelet still contained sensitive information. This was
visible in Kubernetes pod events via `kubectl describe pod`.

The issue was that SanitizeError was called inside the defer block,
but errgrpc.ToGRPC(err) was evaluated before the defer ran, so the
gRPC message contained the original unsanitized error.

Move SanitizeError before the return statement so both the logged
error and the gRPC error are sanitized.

Ref: containerd#5453
Signed-off-by: Aadhar Agarwal <[email protected]>
@chrishenzie
Copy link
Copy Markdown
Member

Closing, need to check source of missing import

@chrishenzie chrishenzie closed this Apr 7, 2026
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Pull Request Review Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cri Container Runtime Interface (CRI) kind/bug size/S

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants