Skip to content

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

Merged
samuelkarp merged 1 commit intocontainerd:release/2.1from
k8s-infra-cherrypick-robot:cherry-pick-12801-to-release/2.1
Jan 21, 2026
Merged

[release/2.1] fix: sanitize error before gRPC return to prevent credential leak in pod events#12803
samuelkarp merged 1 commit intocontainerd:release/2.1from
k8s-infra-cherrypick-robot:cherry-pick-12801-to-release/2.1

Conversation

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

@k8s-infra-cherrypick-robot k8s-infra-cherrypick-robot commented Jan 21, 2026

This is an automated cherry-pick of #12801

/assign AkihiroSuda

Hardening: sanitize errors before returning via gRPC to prevent possible credential leaks in pod events

…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]>
@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Jan 21, 2026
@samuelkarp samuelkarp merged commit 4e2dd3a into containerd:release/2.1 Jan 21, 2026
51 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Jan 21, 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) impact/changelog kind/bug size/S

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants