A malicious or compromised package can make Composer change the permissions of a file outside the package's own folder during composer install, update or require. The file becomes readable and runnable by everyone on the machine. A private file, like an SSH key, can then be read by other users.
The Composer advisory says it doesn't read, change or run the file, and it isn't remote code execution. Composer found no sign of any package on Packagist.org using it.
Who is affected
Projects that depend, even indirectly, on a package you don't fully trust, installed on a machine that holds private files Composer's user can change. Examples include SSH keys, .env files and ~/.aws/credentials. --no-scripts, --no-plugins and allow-plugins don't block it. Run as root, as in many CI containers, any file on the system can be affected.
What to do
Update composer/composer to 2.10.2, or to 2.2.29 if you stay on 2.2. Composer 1.x won't get a fix, so move to 2.x. The fix rejects packages whose binaries point outside their folder. Composer says upgrading is the only complete fix.
A way around this fix was found later. See GHSA-96h3-5x6v-m776, fixed in 2.10.3 and 2.2.30, and update to those.
Reported by iliaal.