Niedrig

compose-lint: .env read through a symlink outside the project can expose the CI job's environment

  • Veröffentlicht: 10.11.2026
  • Aktualisiert: 10.11.2026 18:17

Impact

compose-lint fills in ${VAR} references from the .env file next to the Compose file. It is meant to read nothing outside the project directory, and env_file:, include: and extends: paths are checked for that. The .env read is not. If .env is a symlink, compose-lint follows it wherever it points.

A pull request can add a .env symlink to any file on the CI runner and a Compose file that references a variable from it. compose-lint substitutes the value and quotes it in finding messages, which go to the log and to JSON and SARIF output.

The worst target is /proc/self/environ, the linter's own environment. The Compose file only needs to reference the name of the first variable in it: because that file separates variables with NUL bytes rather than newlines, the substituted value is the entire rest of the environment. On a CI runner that environment holds whatever the workflow put there, including secrets. GitHub masks registered secrets in the job log, but not in uploaded JSON or SARIF artifacts or in Code Scanning alert text.

An include: entry's project_directory: has the same gap from 0.28.0: a directory symlink named there makes compose-lint read .env from wherever the link points.

Pull requests from forks normally run without secrets, and GitHub masks registered secrets in the job log, so in the common setup what can be read is runner metadata and whatever unmasked values the job's environment holds. That is why this is scored as low confidentiality impact. The impact is high in a job that runs untrusted pull requests with secrets in its environment, such as a pull_request_target workflow, or on a CI system that does not mask secrets, and also wherever the JSON or SARIF output is uploaded. The pass/fail result is not affected.

Found during an internal pre-1.0 security review.

Patches

Fixed in 0.31.0. Every .env read now applies the same containment check as env_file:. A .env that resolves outside the project is treated as missing and reported as an unread input. A project_directory: that resolves outside the project is refused, and that entry's files resolve against their own directories. A .env line containing a NUL byte is skipped.

Workarounds

  • Run with --no-env, which skips the sibling .env entirely.
  • Don't run compose-lint on untrusted pull requests in a job whose environment holds secrets.

Reproduction

project/.env -> /proc/self/environ      (symlink)
project/compose.yml:
  services:
    web:
      image: "${FIRST_VAR_NAME}"

compose-lint check compose.yml --format json quotes the environment in the CL-0004 message ("Image '...' has no tag").

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
Python (PyPI) compose-lint >= 0.22.0, < 0.31.0 0.31.0

Verweise

CVSS-Wert 3.1/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N
Schwäche (CWE)
CWE-22, CWE-59
Plattform
Python (PyPI)
Paket
compose-lint
Veröffentlicht
10.11.2026
Aktualisiert
10.11.2026 18:17

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-6wcv-rj3c-mhv3 - CC BY 4.0

Schwachstellenhistorie: compose-lint

Alle veröffentlichten Schwachstellen dieses Pakets (Python (PyPI)), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (10) im Archiv
Einträge insgesamt
10
Erste → letzte
11.2026 11.2026
Ohne Fix
0
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Mittel 3
  • Niedrig 7

Veröffentlichungen pro Jahr

  1. 2026: 10
Schweregrad:
  1. compose-lint: .env read through a symlink outside the project can expose the CI job's environment dieser Eintrag
    Niedrig · 3.1 CVE-2026-123368 >= 0.22.0, < 0.31.0 0.31.0

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.