In recent weeks, security researchers have detected a campaign that uses the PHP ecosystem's own infrastructure to build malware in Laravel projects: several packages published in Packagist were used as legitimate utilities and actually activated persistent remote access to the affected machines. The team that reported the finding published a detailed analysis that you can consult on their blog ( Socket), and the pages of the packages are still accessible in the public register ( author profile in Packagist and individual packages like nhattuanbl / lara-helper, nhattuanbl / simple-queue and nhattuanbl / lara-swagger).
The tactic was not trivial: some of the packages did not contain malicious code directly, but introduced a dependence that did. In particular, one of the packages acts as a bridge and causes another bookstore to be installed as a unit of Composer - the standard unit manager in PHP - with all that it entails ( Composer documentation). This second bookstore includes an affuscated PHP file that, once loaded by the application, establishes communication with a control and control server (C2) and opens a back door.

Analysts describe that the malicious code is designed to make the analysis difficult: the author used control flow outflow techniques, function names and random variables, as well as coding routes and domains. When the payload is run, it collects information from the system and maintains a connection to the C2 using TCP sockets using PHP's own functions (e.g., stream _ socket _ client ()), waiting for orders that may include command execution, file transfer, screenshots and PowerShell running on Windows systems.
The risk goes beyond a simple script that runs: by how the code is activated - when you start the Laravel application through a service provider or by autoloading - malware runs within the same process as the web application. This means that it inherits the permissions and environment variables of the application, and therefore can access credentials stored in .env, database keys, APIs and other secrets that the project has available.
The sample examined tried to reconnect continuously if it did not find a response from the C2 server, which makes it persistent and able to reestablish communication as soon as the attacker reactivated its infrastructure. Although at the time of the report the command server was out of line, the presence of the code in production systems represents a real and lasting threat if it is not acted on.
If your project uses third-party packages, and in particular if you depend on little-known author packages, you have to take a defensive stance. First, you need to quickly identify if any of the mentioned packages are present in the dependency tree by reviewing composer.json and composer.lock and scanning the selling folder for suspicious files such as opussed helpers. If compromised code appears, the wise thing is to eliminate the affected dependence, but that's just the beginning.
Assume there was commitment: any system that has loaded the malicious code should be considered potentially controlled. It is necessary to rotate all credentials that may have been accessible from the application (databases, service keys, third party tokens), to audit network outputs in search of connections to unusual domains or PIs and to review logs to detect remote activity. It is also appropriate to verify integrity and permissions of sensitive files and, if there is any doubt, restore from reliable backup and clean the environment before reproducing it.
This incident fits into the broader pattern of attacks on the software supply chain: malicious actors publish packages with legitimate appearance for developers to install without suspicion. Organizations and developers can reduce the risk by taking practices such as carefully reviewing the origin of the dependencies, setting composer.lock versions, audiating new packages before inclusion and using automated scanning tools that detect suspicious behaviors. Expert projects and security guides on the supply chain offer practical recommendations to be followed, for example, the OWASP community maintains security resources in the software supply chain ( OWASP Supply Chain).

For PHP administrators and developers, it is also useful to know PHP settings that limit attack vectors, such as the directivedisable _ functionsin php.ini, although the malware detected tries to circumvent these protections by testing multiple methods to run commands. The official PHP page documents these and other relevant functions ( disable _ functions in PHP documentation).
The lesson is clear: the comfort of installing a utility from the record cannot replace a minimum diligence. To review the author's reputation, to check the contents of the package before installing it in productive environments and to maintain secret rotation policies are measures that are no longer optional. If you think you have used any of the packages involved, act quickly, document the actions and, if necessary, seek professional help in responding to incidents.
If you want to deepen the technical report, the campaign break-up and specific recommendations are available in the analysis of researchers ( Socket), and package entries can be publicly reviewed in Packagist ( author's profile and the pages of each package). In order to better understand the implications of the supply chain and defence practices, please also consult Community resources and guides such as OWASP and the official documentation of Composer ( Composer).
Related
More news on the same subject.

18-year-old Ukrainian youth leads a network of infostealers that violated 28,000 accounts and left $250,000 in losses
The Ukrainian authorities, in coordination with US agents. They have focused on an operation of infostealer which, according to the Ukrainian Cyber Police, was allegedly adminis...

RAMPART and Clarity redefine the safety of IA agents with reproducible testing and governance from the start
Microsoft has presented two open source tools, RAMPART and Clarity, aimed at changing the way the safety of IA agents is tested: one that automates and standardizes technical te...

The digital signature is in check: Microsoft dismands a service that turned malware into apparently legitimate software
Microsoft announced the disarticulation of a "malware-signing-as-a-service" operation that exploited its device signature system to convert malicious code into seemingly legitim...

A single GitHub workflow token opened the door to the software supply chain
A single GitHub workflow token failed in the rotation and opened the door. This is the central conclusion of the incident in Grafana Labs following the recent wave of malicious ...

WebWorm 2025: the malware that is hidden in Discord and Microsoft Graphh to evade detection
The latest observations by cyber security researchers point to a change in worrying tactics of an actor linked to China known as WebWorm: in 2025 it has incorporated back doors ...

Identity is no longer enough: continuous verification of the device for real-time security
Identity remains the backbone of many security architectures, but today that column is cracking under new pressures: advanced phishing, real-time proxyan authentication kits and...

The dark matter of identity is changing the rules of corporate security
The Identity Gap: Snapshot 2026 report published by Orchid Security puts numbers to a dangerous trend: the "dark matter" of identity - accounts and credentials that are neither ...