Nils Adermann has a new post looking at a problem with Composer where it will install a fork of a project rather than the actual project repository. He points out that it is not a security vulnerability in Composer itself, and is usually cause by using the configuration incorrectly.
Recently there has been an increase of cases in which Composer installs a fork of a package instead of the package the user expects. Most frequently these are forks of packages using a “replace” statement in their composer.json. These forks are usually meant for private use only but are still published on Packagist.
The issue stems from the use of "replace" and the publishing of those forked repositories in the Packagist service. "Replace" is meant to define a fork that is still compatible with the original project. The way that Composer handles finding the correct package to install can cause a conflict and the wrong package could end up "winning".