CVE-2026-123368: compose-lint: .env read through a symlink outside the project can expose the CI job's environment
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 envfile:, 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.
Published Nov 10, 2026
Affected packages
compose-lint
- Ecosystem
- PyPI
- Affected
- >= 0.22.0, <= 0.30.0
- Fixed in
- 0.31.0
- Check
pip show compose-lint
tmatens/compose-lint
- Ecosystem
- GitHub Actions
- Affected
- >= 0.22.0, <= 0.30.0
- Fixed in
- 0.31.0
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.enventirely. - 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").
References
- https://github.com/tmatens/compose-lint/security/advisories/GHSA-6wcv-rj3c-mhv3
- https://nvd.nist.gov/vuln/detail/CVE-2026-123368
- https://github.com/tmatens/compose-lint/pull/917
- https://github.com/tmatens/compose-lint/commit/c43204ad4dab11d54e20574a52bc4e5835246ca5
- https://github.com/tmatens/compose-lint/releases/tag/v0.31.0
- https://github.com/advisories/GHSA-6wcv-rj3c-mhv3
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-123369
compose-lint: Compose file text can issue GitHub Actions workflow commands through the compose-lint Action
medium4.3Nov 10, 2026CVE-2026-123370
compose-lint: `fix --apply` can delete a line the user did not select, including a security setting
medium5.1Nov 10, 2026CVE-2026-123371
compose-lint: A `.compose-lint.yml` symlinked outside the project is read, and a parse error quotes part of the target
low2.3Nov 10, 2026CVE-2026-123372
compose-lint: A pull request can make compose-lint quote a secret from a CI-generated `.env` into its findings
low2.3Nov 10, 2026CVE-2026-123373
compose-lint: A committed symlink makes compose-lint quote a file from outside the project into its output
low2.3Nov 10, 2026CVE-2026-123796
compose-lint: Incomplete fix for GHSA-jf3h-8jvx-vcrg: a run stopped at the finding limit quotes a secret from a CI-generated `.env`
low2.3Nov 10, 2026
