← Übersicht External Secrets Operator

Unbounded memory allocation in template rendering may cause controller denial of service

GHSA-g532-v72x-9hhj

Mittel · CVSS 6.5 Netzwerk · mit Login Fix verfügbar

Veröffentlicht
10.11.2026 14:20
Zuletzt geändert
10.11.2026
EPSS (30 Tage)
unbekannt
CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Beschreibung

Originaltext der Quelle, nicht übersetzt.

## Impact On affected versions, the template engine that renders `ExternalSecret`, `ClusterExternalSecret` and `PushSecret` targets evaluates user-supplied Go templates without bounding the memory a single rendered value may consume. Template functions that take their output size from a numeric argument like `until`, `seq`, `repeat`, `(n)indent`, `rand*` and others allocate that output in full before anything is rendered, and the rendered result accumulates in an unbounded buffer. A single templated value such as `{{ until 35000000 | join " " }}` is therefore enough to exhaust the controller's memory. The process is terminated by the OOM killer, and because the object stays in the cluster it is rendered again on the next reconcile, so the controller crash-loops instead of recovering. This halts reconciliation on ALL the namespaces covered by the instance. Recovery requires an administrator to inspect logs and find the culprint before the object can be removed. We have added, in debug mode, the ability to log which ExternalSecret enters and leaves templating. This allows a deployer to pinpoint the secrets causing the DoS (the one which does not leave templating). Exploitation requires permission to create or update one of these resources in a single namespace The resource is valid against the CRD schema and its cost only materializes during rendering, so admission validation accepts it. ## Workarounds Upgrade to v2.15.0 (Helm chart 2.15.0). If you cannot upgrade immediately: - Restrict create and update on `ExternalSecret`, `ClusterExternalSecret` and `PushSecret` to trusted principals. Note that the common edit `ClusterRole` grants these verbs on every custom resource in a namespace. - Alternatively, reject the generative template functions in `spec.target.template` with a `ValidatingAdmissionPolicy`. This is a denylist and *will not cover every way of constructing a large value*. - Limit the controller's watched namespaces reduces the blast radius (confines an outage to the namespace that caused it). Container memory limits are not a workaround. They make the OOM faster and more reproducible, and the controller still crash-loops. Running without a memory limit is worse rather than better: the process can consume node memory until the kernel OOM killer affects unrelated workloads. ## Background External Secrets Operator renders user-supplied Go templates, extended with an in-tree copy of the Sprig function library, inside the shared controller process. Most template functions produce output proportional to their input, but a number of them size their output from a numeric argument instead. For those, a few bytes of resource specification turn into an arbitrarily large allocation, and the allocation happens inside the function before a single byte reaches the template writer. The writer itself collected the result in a plain buffer, so even incremental output had no ceiling. In a cluster-wide controller scenario, every field of a namespaced custom resource is input from a tenant who may be hostile, and the usual boundary (admission validation) cannot help here. The request is well-formed and its cost becomes apparent only during evaluation, so the limit has to live in the evaluator rather than in the schema or the webhook. v2.15.0 bounds these functions directly: functions that build a collection are capped at 10,000 elements, functions that build a string are capped just below 1 MiB, and the engine renders into a buffer that enforces the same 1 MiB cap per rendered value. Exceeding either limit now fails that one resource with an error on its status, while the controller continues to serve every other tenant. These limits bound memory per rendered value; they do not bound evaluation time, so hardening of the template engine continues in subsequent releases.

Betroffene Pakete im beobachteten Stack

Gogithub.com/external-secrets/external-secrets2.15.0GHSA-g532-v72x-9hhj

Empfohlene Prüfung

  1. Feststellen, ob und in welcher Version die betroffenen Pakete in Ihren Systemen, Images und Abhängigkeiten vorkommen.
  2. Wo eine Fix-Version genannt ist: aktualisieren. Wo nicht: Hersteller-Advisory und Referenzen auf Workarounds prüfen.
  3. Erreichbarkeit beachten: Der Angriffsweg (Netzwerk · mit Login) ist aus dem CVSS-Vektor abgeleitet.

Diese Seite sagt nichts darüber, ob Ihre Systeme betroffen sind. Das klärt erst eine Prüfung Ihrer Versionen.