Laravel-Lang PHP Packages Compromised to Deliver Cross-Platform Credential Stealer: A Deep Dive into the Supply Chain Attack
The Laravel-Lang PHP packages have been compromised in a sophisticated supply chain attack, posing a significant threat to developers and organizations using these packages. This attack highlights the critical importance of supply chain security and the potential for widespread damage when malicious actors gain access to widely used software components.
The Attack Unveiled
Cybersecurity researchers have uncovered a concerning campaign targeting multiple Laravel-Lang PHP packages. These packages, including laravel-lang/lang, laravel-lang/http-statuses, laravel-lang/attributes, and laravel-lang/actions, have been manipulated to deliver a comprehensive credential-stealing framework. The timing and pattern of the newly published tags suggest a broader compromise of the Laravel Lang organization's release process.
The attack involves the rapid publication of over 700 versions of these packages, with many versions appearing in quick succession. This automated mass tagging or republishing indicates that the attacker may have obtained access to organization-level credentials, repository automation, or release infrastructure. The core malicious functionality is embedded in the file src/helpers.php, which fingerprints the infected host and contacts an external server (flipboxstudio[.]info) to retrieve a cross-platform PHP payload.
The Payload and Its Capabilities
The payload, a ~5,900-line PHP credential stealer, is organized into fifteen specialist collector modules. It collects a wide range of sensitive data from compromised systems, including:
- IAM roles and instance identity documents from cloud metadata endpoints
- Google Cloud application default credentials
- Microsoft Azure access tokens and service principal profiles
- Kubernetes Service Account tokens and Helm registry configurations
- Authentication tokens for various cloud platforms (DigitalOcean, Heroku, Vercel, Netlify, Railway, and Fly.io)
- HashiCorp Vault tokens
- Tokens and configurations from CI/CD tools (Jenkins, GitLab Runners, GitHub Actions, CircleCI, TravisCI, and ArgoCD)
- Seed phrases and files associated with cryptocurrency wallets and extensions
- Browser history, cookies, and login data from multiple browsers (Google Chrome, Microsoft Edge, Mozilla Firefox, Brave, and Opera)
- Local vaults and browser extension data for popular password managers
- PuTTY/WinSCP saved sessions
- Windows Credential Manager dumps
- RDP files
- Session tokens for applications like Discord, Slack, and Telegram
- Data from email clients and FTP clients
- Configuration and credential files containing Docker auth tokens, SSH private keys, Git credentials, and more
The Stealing Process
The payload is designed to be stealthy and persistent. It generates a unique per-host marker (an MD5 hash combining the directory path, system architecture, and inode) to ensure that the payload only triggers once per machine. This prevents redundant executions and helps the malware remain undetected after the initial run. The stolen data is encrypted with AES-256 and sent to the attacker's server (flipboxstudio[.]info/exfil). The malware then deletes itself from the disk to limit forensic evidence.
Implications and Recommendations
This attack highlights the importance of supply chain security and the need for developers and organizations to prioritize the protection of their software components. Here are some key takeaways and recommendations:
- Supply Chain Security: Organizations should implement robust supply chain security practices, including secure package management, code signing, and regular security audits. Regularly updating and patching dependencies is crucial to prevent exploitation.
- Monitoring and Detection: Implementing comprehensive monitoring and detection systems can help identify compromised packages and potential attacks. This includes monitoring package versions, network traffic, and system behavior.
- Incident Response: Organizations should have a well-defined incident response plan to address potential breaches promptly. This includes isolating affected systems, containing the attack, and notifying affected parties.
- User Awareness: Developers and users should be educated about the risks associated with supply chain attacks and the importance of using secure and trusted sources for software dependencies.
In conclusion, the compromise of Laravel-Lang PHP packages serves as a stark reminder of the vulnerabilities present in software supply chains. It emphasizes the need for vigilance, proactive security measures, and a holistic approach to safeguarding against such threats.