Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Vulnerabilities

Critical Vulnerability Patched in PHP Package Repository

A critical remote code execution vulnerability was recently addressed in packagist.org

A critical remote code execution vulnerability was recently addressed in packagist.org, a large PHP package repository, a security researcher reveals.

An open source project, Packagist is the default package server behind Composer, a tool for dependency management in PHP, as it aggregates public PHP packages installable with the utility. The packagist.org site helps users search for packages and lets Composer know where to get the code from.

Statistics on the website show that Packagist has delivered billions of packages since its inception in 2012, and that it is currently serving around 400 million package installs per month.

What security researcher Max Justicz discovered was that there was a “big text field on the site” that allowed anyone to type $(execute me), which would result in the command being executed in a shell.

The issue, Justicz says, resided in the package repository’s functionality that allows users to upload packages.

“You upload packages to Packagist by providing a URL to a Git, Perforce, Subversion, or Mercurial repository. To identify what kind of repository the URL points to, Packagist shells out to git, p4, svn, and hg, with application-specific commands that include this URL as an argument,” the researcher notes.

However, when checking the provided URL, Packagist was improperly escaping input. Any commands an attacker would have provided were executed twice.

“The Packagist team quickly resolved this issue by escaping the relevant parameters in the Composer repository,” Justicz reveals.

Advertisement. Scroll to continue reading.

The security researcher, who over the past year discovered multiple issues on popular repositories, warns of the high probability that package manager servers could be compromised in the future.

“The flaw could have been easily avoided by setting parameters on what users can input into text boxes. Without parameters, text boxes become entry points for bad actors to execute malicious commands in order to access the server and, once there, potentially gain access to credentials that will let them hop from one server to another while harvesting sensitive information,” Mike Bittner, Digital Threat Analyst for The Media Trust, told SecurityWeek in an emailed comment.

“Developers should make security a priority all throughout a product’s lifecycle stages, from concept to manufacturing to retirement. Website operators should police all their website third-party code providers to ensure their activities align with policies, and scan their sites to identify and obstruct unauthorized code,” Bittner concluded.

Related: Critical Vulnerabilities Patched in Apache CouchDB

Related: Several Vulnerabilities Patched in RubyGems

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Click to comment

Trending

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Join the session as we discuss the challenges and best practices for cybersecurity leaders managing cloud identities.

Register

SecurityWeek’s Ransomware Resilience and Recovery Summit helps businesses to plan, prepare, and recover from a ransomware incident.

Register

Expert Insights

Related Content

Vulnerabilities

Less than a week after announcing that it would suspended service indefinitely due to a conflict with an (at the time) unnamed security researcher...

Data Breaches

OpenAI has confirmed a ChatGPT data breach on the same day a security firm reported seeing the use of a component affected by an...

IoT Security

A group of seven security researchers have discovered numerous vulnerabilities in vehicles from 16 car makers, including bugs that allowed them to control car...

Vulnerabilities

A researcher at IOActive discovered that home security systems from SimpliSafe are plagued by a vulnerability that allows tech savvy burglars to remotely disable...

Risk Management

The supply chain threat is directly linked to attack surface management, but the supply chain must be known and understood before it can be...

Cybercrime

Patch Tuesday: Microsoft calls attention to a series of zero-day remote code execution attacks hitting its Office productivity suite.

Vulnerabilities

Patch Tuesday: Microsoft warns vulnerability (CVE-2023-23397) could lead to exploitation before an email is viewed in the Preview Pane.

Vulnerabilities

The latest Chrome update brings patches for eight vulnerabilities, including seven reported by external researchers.