{"id":"GHSA-6wcv-rj3c-mhv3","summary":"compose-lint: .env read through a symlink outside the project can expose the CI job's environment","details":"### Impact\n\ncompose-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.\n\nA 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.\n\nThe 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.\n\nAn `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.\n\nPull 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.\n\nFound during an internal pre-1.0 security review.\n\n### Patches\n\nFixed 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.\n\n### Workarounds\n\n- Run with `--no-env`, which skips the sibling `.env` entirely.\n- Don't run compose-lint on untrusted pull requests in a job whose environment holds secrets.\n\n### Reproduction\n\n```\nproject/.env -\u003e /proc/self/environ      (symlink)\nproject/compose.yml:\n  services:\n    web:\n      image: \"${FIRST_VAR_NAME}\"\n```\n\n`compose-lint check compose.yml --format json` quotes the environment in the CL-0004 message (\"Image '...' has no tag\").","aliases":["CVE-2026-123368"],"modified":"2026-11-10T16:15:05.349515815Z","published":"2026-11-10T15:56:56Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2026-11-10T15:56:56Z","nvd_published_at":"2026-11-09T18:17:25Z","cwe_ids":["CWE-22","CWE-59"],"severity":"LOW"},"references":[{"type":"WEB","url":"https://github.com/tmatens/compose-lint/security/advisories/GHSA-6wcv-rj3c-mhv3"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-123368"},{"type":"WEB","url":"https://github.com/tmatens/compose-lint/pull/917"},{"type":"WEB","url":"https://github.com/tmatens/compose-lint/commit/c43204ad4dab11d54e20574a52bc4e5835246ca5"},{"type":"PACKAGE","url":"https://github.com/tmatens/compose-lint"},{"type":"WEB","url":"https://github.com/tmatens/compose-lint/releases/tag/v0.31.0"}],"affected":[{"package":{"name":"compose-lint","ecosystem":"PyPI","purl":"pkg:pypi/compose-lint"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.22.0"},{"fixed":"0.31.0"}]}],"versions":["0.22.0","0.23.0","0.24.0","0.25.0","0.26.0","0.27.0","0.28.0","0.29.0","0.30.0"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-6wcv-rj3c-mhv3/GHSA-6wcv-rj3c-mhv3.json","last_known_affected_version_range":"\u003c= 0.30.0"}},{"package":{"name":"tmatens/compose-lint","ecosystem":"GitHub Actions"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.22.0"},{"fixed":"0.31.0"}]},{"type":"GIT","repo":"https://github.com/tmatens/compose-lint","events":[{"introduced":"811ef6b379dbc78d048fcedaf976205705d4a7c3"},{"fixed":"a6a7a76736de1c72abfa96c41ff8af556ffdc55f"}]}],"versions":["v0.30.0","v0.29.0","v0.28.0","v0.27.0","v0.26.0","v0.25.0","v0.24.0","v0.23.0","v0.22.0"],"database_specific":{"last_known_affected_version_range":"\u003c= 0.30.0","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-6wcv-rj3c-mhv3/GHSA-6wcv-rj3c-mhv3.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N"},{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"}]}