CVE-2025-59303 Overview
CVE-2025-59303 affects the HAProxy Kubernetes Ingress Controller before version 3.1.13. The flaw occurs when the config-snippets feature flag is enabled. Users with create or update permissions on ingress resources can submit crafted config snippets. The controller processes these snippets and returns an ingress token secret in the response. This exposes sensitive credentials to authenticated users who should not have direct access to secret material. The weakness is classified under [CWE-791] (Incomplete Filtering of Special Elements).
Critical Impact
Authenticated Kubernetes users with ingress write permissions can retrieve ingress token secrets by injecting config snippets into the HAProxy Ingress Controller.
Affected Products
- HAProxy Kubernetes Ingress Controller before 3.1.13
- HAProxy Enterprise Kubernetes Ingress Controller before 3.0.16-ee1
- HAProxy Enterprise Kubernetes Ingress Controller before 1.11.13-ee1 and 1.9.15-ee1
Discovery Timeline
- 2025-10-08 - CVE-2025-59303 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-59303
Vulnerability Analysis
The HAProxy Kubernetes Ingress Controller supports a config-snippets feature that allows administrators to inject custom HAProxy configuration fragments through ingress annotations. When this feature flag is active, the controller accepts snippets from any user with permission to create or update ingress objects. The controller does not adequately filter snippet content before processing. As a result, a snippet can reference internal template variables that resolve to the ingress token secret. The controller then returns that secret in the response back to the requester, leaking credential material intended for internal use.
Root Cause
The root cause is incomplete filtering of special elements in user-supplied configuration snippets [CWE-791]. The controller trusts snippet input from any authenticated user with ingress write access. It does not enforce a privilege boundary between users who can shape configuration and users who should see secret values.
Attack Vector
An attacker needs valid Kubernetes credentials with create or update rights on ingress resources in a target namespace. The attacker submits an ingress object containing a crafted config snippet annotation. The HAProxy controller processes the snippet and returns the ingress token secret in the API response or reconciler output. Refer to the HAProxy Blog CVE-2025-59303 Analysis for the vendor's technical write-up.
Detection Methods for CVE-2025-59303
Indicators of Compromise
- Ingress objects containing unusual haproxy.org/config-snippet annotations referencing template variables or secret paths.
- Kubernetes audit log entries showing create or update operations on ingress resources by service accounts that do not normally manage ingress.
- Unexpected reads or references to the ingress controller's token secret in reconciler logs.
Detection Strategies
- Audit Kubernetes RBAC to enumerate every principal with create or update verbs on ingresses.networking.k8s.io resources.
- Inspect running HAProxy Ingress Controller deployments for the --configsnippets-enabled or equivalent flag and correlate with ingress annotation contents.
- Review controller pod logs for snippet parsing events tied to non-administrative service accounts or user identities.
Monitoring Recommendations
- Alert on any ingress annotation change that adds or modifies config-snippet fields, especially outside change-management windows.
- Monitor Kubernetes API server audit logs for ingress writes originating from workload service accounts rather than platform operators.
- Track HAProxy Enterprise Ingress Controller version across clusters and flag deployments below 3.1.13, 3.0.16-ee1, 1.11.13-ee1, or 1.9.15-ee1.
How to Mitigate CVE-2025-59303
Immediate Actions Required
- Upgrade the HAProxy Kubernetes Ingress Controller to 3.1.13 or later. For HAProxy Enterprise, upgrade to 3.0.16-ee1, 1.11.13-ee1, or 1.9.15-ee1.
- Disable the config-snippets feature flag if the upgrade cannot be applied immediately.
- Rotate the ingress controller token secret and any credentials that may have been exposed through snippet processing.
Patch Information
HAProxy addresses the issue in Kubernetes Ingress Controller 3.1.13. The HAProxy Enterprise fixed builds are 3.0.16-ee1, 1.11.13-ee1, and 1.9.15-ee1. See the HAProxy Blog CVE-2025-59303 Analysis for the vendor's patch notes.
Workarounds
- Set the controller's config-snippets feature flag to disabled until patched versions are deployed.
- Restrict RBAC so only cluster administrators hold create and update verbs on ingress resources in production namespaces.
- Use Kubernetes admission controllers (for example, OPA Gatekeeper or Kyverno) to reject ingress objects that carry config-snippet annotations.
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

