Developers maintaining Composer, which is a package manager for PHP, have pushed an update to address a critical vulnerability. Composer is a tool for dependency management in PHP that makes installation of packages for a project easier.

CVE-2021-29472Composer is a dependency manager for PHP. URLs for Mercurial repositories in the root composer.json and package source download URLs are not sanitized correctly. Specifically crafted URL values allow code to be executed in the HgDriver if hg/Mercurial is installed on the system. The impact to Composer users directly is limited as the composer.json file is typically under their own control and source download URLs can only be supplied by third party Composer repositories they explicitly trust to download and execute source code from, e.g. Composer plugins. The main impact is to services passing user input to Composer, including and Private Packagist. This allowed users to trigger remote code execution. The vulnerability has been patched on and Private Packagist within 12h of receiving the initial vulnerability report and based on a review of logs, to the best of our knowledge, was not abused by anyone. Other services/tools using VcsRepository/VcsDriver or derivatives may also be vulnerable and should upgrade their composer/composer dependency immediately. Versions 1.10.22 and 2.0.13 include patches for this issue.

This vulnerability could allow threat actors to execute arbitrary commands and backdoor PHP packages. The Composer developers explained, “To the best of our knowledge the vulnerability has not been exploited.”

According to SonarSource security researchers, the vulnerability is a derivative of the way package source download URLs are handled, which can lead to a situation where threat actors trigger remote command injection.

SonarSource researchers also said, “A vulnerability in such a central component, serving more than 100 million package metadata requests per month has a huge impact as this access could have been used to steal maintainers’ credentials or to redirect package downloads to third-party servers delivering backdoored dependencies.”

SpearTip’s engineers and developers are actively keeping up with these vulnerabilities to prevent threats from abusing them and entering your environment unwarranted. Keeping up with these can be difficult for organizations, so allowing the analysts in our security operations center to monitor your networks will ease headaches that come along with these security issues.

Our team will continuously monitor environments 24/7 in our US based Security Operations Center. Our certified engineers work in unison with our proprietary endpoint detection and response tool, ShadowSpear®. This allows your organization to have a direct communication with our engineers at any moment and a completely transparent view of your risk profile.

If you think your organization has been breached, call our Security Operations Center at 833.997.7327.