Summary
Fleet's agent-side deployer fails to filter security-sensitive labels when applying namespaceLabels from fleet.yaml or BundleDeployment options to target namespaces.
An attacker with git push access to a Fleet-monitored repository can override Pod Security Standards enforcement labels, weakening admission controls and enabling workloads that should be blocked.
Affected context
This vulnerability occurs in environments using Fleet to manage Kubernetes namespaces and workloads via GitOps-style configuration.
It is relevant when:
- Fleet is configured to sync
namespaceLabelsfrom fleet.yaml or BundleDeployment.spec.options.namespaceLabels - Pod Security Standards (or similar admission policies) rely on labels in the target namespaces to determine enforcement mode
- Users with repository write access can define or modify namespace labels that are propagated without filtering
Exploit preconditions
- Attack surface: Git-managed configuration repositories monitored by Fleet.
- Required access: Ability to push changes to a Fleet-monitored Git repository (e.g., developer or CI account with write access).
- Trigger point: Fleet agent processing fleet.yaml or BundleDeployment options and applying
namespaceLabelsto a Kubernetes namespace. - Why exploitation is possible: The deployer treats all
namespaceLabelsas trusted and does not filter or protect security-sensitive keys controlling Pod Security Standards or admission policies.
Why this happens
The underlying issue is the lack of proper protection and segregation for security-sensitive configuration values, mapping to CWE-522: Insufficiently Protected Credentials by analogy to sensitive policy controls.
In abstract terms, the system exposes critical security controls (PSS enforcement labels) through a general-purpose configuration channel (namespaceLabels) that is writable by non-privileged actors.
Because Fleet does not distinguish or restrict labels that affect admission control, untrusted configuration can directly override security policy enforcement, resulting in a silent weakening of cluster defenses.
Potential impact
- Attackers may reduce or disable Pod Security Standards enforcement on targeted namespaces.
- They could deploy privileged or otherwise non-compliant workloads that admission policies should reject.
- Attackers can run containers with elevated capabilities, hostPath mounts, or other dangerous settings.
- Malicious workloads can gain a stronger foothold in the cluster, facilitating lateral movement or data exfiltration.
General mitigation guidance
Mitigations should focus on separating security-critical controls from general configuration and treating them as privileged data.
Recommended patterns include:
- Defining a dedicated, restricted mechanism for policy-related namespace labels, separate from user-controlled
namespaceLabels. - Implementing server-side filtering or whitelisting so that Fleet will not modify labels used for Pod Security Standards or admission control.
- Enforcing least-privilege on Git repository access, limiting who can change cluster-wide or namespace-level settings.
- Applying defense-in-depth by configuring admission controllers and cluster policies that do not rely solely on labels controlled from Git.
How teams detect issues like this
Detection typically involves monitoring configuration changes and validating them against security policies.
Useful approaches include:
- Static scanning of Git repositories for modifications to known security-sensitive label keys associated with PSS or admission control.
- Policy-as-code checks in CI that block pull requests altering protected namespace labels or bundle options.
- Kubernetes audit log analysis to detect changes to namespace labels, especially transitions that weaken enforcement modes.
- Periodic cluster conformance checks to validate that namespaces maintain expected Pod Security profiles and cannot be downgraded from Git.

