Skip to content

fix(k8s): loki runs from the grafana-community chart on loki 3.7, out of reach of cve-2026-21729 #1632

Closed

Description

@dan-petty

Friction

Loki is stuck on 3.6.11 because its chart source turned into the Grafana Enterprise Logs chart. grafana/loki 7.3.0 is the last version in grafana.github.io/helm-charts, whose loki chart now describes itself as "Helm chart for Grafana Enterprise Logs"; the open-source chart continues as grafana-community/loki. Loki 3.6 has no fix for CVE-2026-21729 (memory exhaustion through one detected_fields request with a huge limit, fixed only in >= 3.7.0), and Loki runs with auth_enabled: false.

Evidence

Live, read-only, 2026-10-17:

  • StatefulSet logging/loki: label helm.sh/chart=loki-7.3.0, image docker.io/grafana/loki:3.6.11; loki-canary pods run 3.6.12. Application loki Synced and Healthy at [7.3.0, 3dd7fa6]. loki-0 has a 2Gi memory limit and 0 restarts.
  • NetworkPolicy logging-default-perimeter admits 3100 only from pods in logging, the monitoring namespace and the otel-collector pods, with no Traefik peer; so the realistic callers are monitoring pods, the collector and signed-in Grafana users through the Loki datasource (Logs Drilldown uses detected_fields).

Repo and charts:

  • k8s/argocd/apps/loki.yaml:11-13 (grafana.github.io/helm-charts, loki, 7.3.0); src/devops_cli/commands/k8s/stack_lifecycle.py:164-170 (grafana/loki 7.3.0) and :67-69 (logging stack repo grafana only); k8s/logging/loki-values.yaml:8 auth_enabled: false; k8s/ingress/ingress-routes.yaml:365-385 loki-ingress, whose backend the logging policy blocks by design.
  • helm show chart grafana/loki --version 7.3.0: description "Helm chart for Grafana Enterprise Logs", appVersion 3.6.12, values pin loki.image.tag 3.6.11. helm search repo grafana-community/loki: 18.17.1 (app 3.7.8). The community chart's 7.x to 8.0.0 notes say GEL support was removed (Grafana Loki Helm Chart Migration to grafana-community/helm-charts grafana/loki#20705); 9.0.0 removed monitoring.selfMonitoring.
  • grafana.com advisory CVE-2026-21729: Medium, CVSS 7.5, fixed in >= 3.7.0, no 3.6.x backport.
  • helm template with the repo values renders the same StatefulSet selector and volumeClaimTemplates (claim storage, RWO, 20Gi) for 7.3.0 and 18.17.1, so the upgrade keeps claim storage-loki-0 in place; the orphan-and-rebind procedure at k8s/README.md:213 is not needed.
  • AppProject homelab already allows the grafana-community repo (k8s/argocd/apps/projects.yaml:16).

Remedy

  1. Tests first: pin the Loki release to grafana-community/loki and its version in both deploy-stack and the Argo CD Application (one structural-tuple test), and assert loki-values.yaml has no monitoring.selfMonitoring key and keeps deletion_mode: disabled, compactor retention and retention_period: 720h.
  2. stack_lifecycle.py:67-69: add the grafana-community repo to the logging stack; :166 grafana-community/loki, :169 18.17.1. k8s/argocd/apps/loki.yaml:11,13: repoURL https://grafana-community.github.io/helm-charts, targetRevision 18.17.1.
  3. k8s/logging/loki-values.yaml: update the header (:2-3) and delete monitoring.selfMonitoring (:68-72). The 18.0.0 metric label change from cluster to app_instance does not touch the repo's Loki alerts (k8s/monitoring/prometheus-values.yaml:414,427), which do not filter on cluster.
  4. Run kubectl apply --dry-run=server on the render against the logging namespace's baseline level, and confirm the images are loki and loki-canary 3.7.8.
  5. Follow-up decision in the same PR or a note: either admit Traefik in the logging policy with a stated reason, or delete loki-ingress, whose backend the policy blocks.
    Coordinate with fix(k8s): chart defaults stop writing logs and watches nobody reads (loki canary and per-query delete warnings, pyroscope debug logging, grafana's datasource sidecar), and loki admits only grafana and alloy from monitoring #1133, which edits loki-values.yaml (canary off) in the same file.

Priority: P2. Severity medium: a known availability CVE on a chart line that gets no open-source updates, reachable only from inside the cluster or through signed-in Grafana.

Proposed design

Problem statement

Loki runs version 3.6.11 from the grafana/loki chart, which is now the Grafana Enterprise Logs chart. It receives no open-source updates. CVE-2026-21729 causes memory exhaustion through one detected_fields request with a huge limit. The fix exists only in Loki 3.7.0 and later, with no 3.6.x backport. The deployment runs with auth_enabled: false, so any caller inside the cluster or a signed-in Grafana user can trigger it. This issue moves Loki to the grafana-community/loki chart at version 18.17.1, which ships Loki 3.7.8.

Acceptance criteria

  • Criterion 1: The Loki StatefulSet and loki-canary pods run image tag 3.7.8.
    Verification: Run kubectl get statefulset -n logging loki -o jsonpath='{.spec.template.spec.containers[0].image}' and confirm the tag is 3.7.8.
  • Criterion 2: The Argo CD Application uses the grafana-community/loki chart at version 18.17.1.
    Verification: Check k8s/argocd/apps/loki.yaml for repoURL https://grafana-community.github.io/helm-charts, chart loki, targetRevision 18.17.1.
  • Criterion 3: The deploy-stack logging stack references grafana-community/loki at version 18.17.1.
    Verification: Run devops k8s deploy-stack --stack logging --dry-run and confirm the chart is grafana-community/loki at 18.17.1.
  • Criterion 4: The loki-values.yaml has no monitoring.selfMonitoring key and keeps deletion_mode, compactor retention, and retention_period.
    Verification: Grep k8s/logging/loki-values.yaml for selfMonitoring (absent), deletion_mode: disabled, retention_enabled: true, and retention_period: 720h (present).
  • Criterion 5: A structural test pins the Loki chart name and version for both deploy-stack and Argo CD.
    Verification: Run the test suite and confirm the new test passes, asserting the chart name and version tuple for both paths.
  • Criterion 6: The rendered manifests pass a server dry-run against the logging namespace.
    Verification: Run kubectl apply --dry-run=server -n logging on the rendered output and confirm no errors.

Key questions

  • What is the current version of Loki in use?: Loki 3.6.11, from chart grafana/loki 7.3.0. [sources: k8s/argocd/apps/loki.yaml]
  • What is the version of the Grafana Enterprise Logs chart that replaces the open-source loki chart?: 7.3.0, the last version in grafana.github.io/helm-charts. [sources: k8s/argocd/apps/loki.yaml:13]
  • Should the loki-ingress be modified to admit Traefik or deleted?: Pending decision. Two options: admit Traefik in the logging NetworkPolicy with a stated reason, or delete loki-ingress because the policy blocks its backend by design. (proposed) [sources: k8s/ingress/ingress-routes.yaml:365-385, k8s/logging/networkpolicy.yaml]
  • What is the fixed version of Loki that addresses CVE-2026-21729?: Loki 3.7.0 and later. No 3.6.x backport exists. [sources: k8s/argocd/apps/loki.yaml]
  • What is the new version of Loki to upgrade to in order to fix CVE-2026-21729?: Loki 3.7.8, shipped by grafana-community/loki chart 18.17.1. [sources: k8s/argocd/apps/projects.yaml:16]
  • What chart repository should be used for the Loki upgrade?: https://grafana-community.github.io/helm-charts, already allowed in the AppProject. [sources: k8s/argocd/apps/projects.yaml:16]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/security
    on Oct 18, 2026
  2. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/security. The candidate addresses a known security vulnerability CVE-2026-21729 in Loki.
    • Priority: P2-Medium. The issue is a known availability CVE affecting a chart line without open-source updates, reachable only from inside the cluster or through signed-in Grafana.
    • Value: High. Fixing the CVE prevents potential denial of service and impacts the security posture of the system.
    • Effort: Medium. The fix involves updating chart sources, values files, and coordinating with other ongoing changes.
  3. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at d509dba (see proposed design in issue body).

  4. added
    priority/p2-medium
    status/ready
    effort/medium
    value/high
    on Oct 28, 2026
  5. added 2 commits that reference this issue on Oct 28, 2026
    96c50c9
    7c956e3
  6. removed
    status/ready
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumsource/agenttype/securityvalue/high

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions