Docker Compose versions from 2.34.0 up to but not including 2.40.2 are vulnerable to a path traversal issue via OCI artifact layer annotations. This vulnerability allows an attacker to escape the local cache directory and overwrite arbitrary files on the host machine, even when running read-only commands. The flaw arises because Docker Compose trusts and joins attacker-supplied path information from specific OCI annotations without proper validation. A fix is available in version 2.40.2.