Over 600 Laravel Apps Exposed to Remote Code Execution Due to Leaked APP_KEYs on GitHub
Vulnerabilities mentionedAll →
| CVE | Vulnerability | CVSS | EPSS | Flags | Affected | Exposure | Published |
|---|---|---|---|---|---|---|---|
| CVE-2018-15133 | Deserialization RCE in Laravel Framework via X-XSRF-TOKEN Header CVE-2018-15133 is a PHP deserialization flaw (CWE-502) in Laravel Framework versions through 5.5.40 and 5.6.x through 5.6.29: the decrypt method in Illuminate/Encryption/Encrypter.php passes the decrypted X-XSRF-TOKEN header value to unserialize, enabling PHP object injection via the PendingBroadcast gadget chain. A remote attacker triggers it by sending a crafted X-XSRF-TOKEN header, but only if they know the application's APP_KEY, which typically happens because the key was leaked (e.g., committed to public GitHub repositories) or reused across deployments. Successful exploitation yields remote code execution on the web server with high impact to confidentiality, integrity, and availability; in current campaigns the AndroxGh0st malware exploits this flaw to steal AWS, Azure, and Office 365 credentials and now also distributes Mozi botnet payloads. Any Laravel 5.5.x or 5.6.x application within the affected ranges is exposed, with practical risk concentrated on apps whose APP_KEY has been exposed or shared. Exploitation is confirmed in the wild: CISA added the flaw to the KEV catalog on 2024-01-16, EPSS puts the 30-day exploitation probability at about 77%, and public scanning has already identified 600+ Laravel apps with leaked APP_KEYs on GitHub. Do: Upgrade Laravel Framework to a release later than 5.6.29 (latest patched 5.6.x or a supported major version) per vendor guidance; CISA's KEV required action is to apply vendor mitigations or discontinue use of the product if mitigations are unavailable. Because exploitation requires knowing the APP_KEY, audit and rotate the key, remove it from public repositories and exposed .env files, and hunt for AndroxGh0st activity (suspicious processes, outbound credential theft) on Laravel hosts. | 8.1 | 77% | KEV PoC |
| large≈10,000–100,000 internet-facing Laravel deployments plausibly affected (600+ apps already confirmed with leaked APP_KEYs on GitHub alone) | |
| CVE-2024-55556 | Unauthenticated RCE in Crater Invoice via Laravel APP_KEY and tampered session cookie Crater Invoice, a self-hosted Laravel-based invoicing application, contains a deserialization flaw (CWE-502) that allows an unauthenticated attacker to achieve remote command execution. The attack requires knowledge of the application's Laravel APP_KEY: with it, the attacker can decrypt the laravel_session cookie, alter the serialized data inside it, re-encrypt the value, and send it back, causing the server to deserialize attacker-controlled data and execute commands. Successful exploitation yields full remote command execution on the host, consistent with the critical 9.8 CVSS score covering confidentiality, integrity, and availability. Any internet-reachable Crater instance whose APP_KEY is known, guessed, or leaked is exposed; related reporting indicates over 600 Laravel apps have leaked APP_KEYs committed on GitHub. No public proof-of-concept or confirmed in-the-wild exploitation is known, but EPSS assigns a 44.1% probability of exploitation within 30 days, so preemptive mitigation is warranted. Do: Check whether your Crater deployment's APP_KEY has ever been committed to a repository or otherwise disclosed, and rotate it if so, noting that rotation invalidates existing sessions. Limit internet exposure of the instance (restrict access or place it behind a VPN/reverse proxy with access controls) until patched, and apply the vendor's update as soon as a fixed release is published, since no fixed version is specified in the available data. | 9.8 | 44% |
| moderate≈1,000–10,000 self-hosted instances (estimate) |
Full article844 words · extracted from thehackernews.com · click to collapse
Cybersecurity researchers have discovered a serious security issue that allows leaked Laravel APP_KEYs to be weaponized to gain remote code execution capabilities on hundreds of applications.
"Laravel's APP_KEY, essential for encrypting sensitive data, is often leaked publicly (e.g., on GitHub)," GitGuardian said. "If attackers get access to this key, they can exploit a deserialization flaw to execute arbitrary code on the server – putting data and infrastructure at risk."
The company, in collaboration with Synacktiv, said it was able to extract more than 260,000 APP_KEYs from GitHub from 2018 to May 30, 2025, identifying over 600 vulnerable Laravel applications in the process. GitGuardian said it observed over 10,000 unique APP_KEYs across GitHub, of which 400 APP_KEYs were validated as functional.
APP_KEY is a random 32-byte encryption key that's generated during the installation of Laravel. Stored in the .env file of the application, it's used to encrypt and decrypt data, generate secure, random strings, sign and verify data, and create unique authentication tokens, making a crucial security component.
GitGuardian noted that Laravel's current implementation of decrypt() function introduces a security issue wherein it automatically deserializes decrypted data, thereby opening the door for possible remote code execution.
"Specifically in Laravel applications, if attackers obtain the APP_KEY and can invoke the decrypt() function with a maliciously crafted payload, they can achieve remote code execution on the Laravel web server," security researcher Guillaume Valadon said.
"This vulnerability was first documented with CVE-2018-15133, which affected Laravel versions prior to 5.6.30. However, this attack vector persists in newer Laravel versions when developers explicitly configure session serialization in cookies using the SESSION_DRIVER=cookie setting, as demonstrated by CVE-2024-55556."
It's worth noting that CVE-2018-15133 has been exploited in the wild by threat actors associated with the AndroxGh0st malware, after scanning the internet for Laravel applications with misconfigured .env files.
Further analysis has found that 63% of APP_KEY exposures originate from .env files (or their variants) that typically contain other valuable secrets, such as cloud storage tokens, database credentials, and secrets associated with e-commerce platforms, customer support tools, and artificial intelligence (AI) services.
More importantly, approximately 28,000 APP_KEY and APP_URL pairs have been concurrently exposed on GitHub. Of these, approximately 10% have been found to be valid, rendering 120 applications vulnerable to trivial remote code execution attacks.
Given that the APP_URL configuration specifies the application's base URL, exposing both APP_URL and APP_KEY creates a potent attack vector that threat actors can leverage to directly access the app, retrieve session cookies, and attempt to decrypt them using the exposed key.
Simply scrubbing secrets from repositories isn't enough, especially when they've already been cloned or cached by third-party tools. What developers need is a clear rotation path, backed by monitoring that flags every future reappearance of sensitive strings across CI logs, image builds, and container layers.
"Developers should never simply delete exposed APP_KEYs from repositories without proper rotation," GitGuardian said. "The proper response involves: immediately rotating the compromised APP_KEY, updating all production systems with the new key, and implementing continuous secret monitoring to prevent future exposures."
These types of incidents also align with a broader class of PHP deserialization vulnerabilities, where tools like phpggc help attackers craft gadget chains that trigger unintended behaviors during object loading. When used in Laravel environments with leaked keys, such gadgets can achieve full RCE without needing to breach the app’s logic or routes.
The disclosure comes after GitGuardian revealed that it discovered a "staggering 100,000 valid secrets" in Docker images publicly accessible on the DockerHub registry. This includes secrets associated with Amazon Web Services (AWS), Google Cloud, and GitHub tokens.
A new Binarly analysis of over 80,000 unique Docker images spanning 54 organizations and 3,539 repositories has likewise uncovered 644 unique secrets that encompassed generic credentials, JSON Web Tokens, HTTP Basic Authorization header, Google Cloud API key, AWS access tokens, and CircleCI API tokens, among others.
"Secrets appear in a wide variety of file types, including source code, configuration files, and even large binary files, areas where many existing scanners fall short," the company said. "Moreover, the presence of entire Git repositories inside container images represents a serious and often overlooked security risk."
But that's not all. The rapid adoption of Model Context Protocol (MCP) to enable agentic workflows in enterprise-driven AI applications has opened up brand new attack vectors – a concerning one being the leakage of secrets from MCP servers published to GitHub repositories.
Specifically, GitGuardian found that 202 of them leaked at least one secret, accounting for 5.2% of all the repositories – a number that the company said is "slightly higher than the 4.6% occurrence rate observed on all public repositories," making MCP servers a "new source of secret leaks."
While this research focuses on Laravel, the same root problem – unguarded secrets in public repositories – applies to other stacks. Organizations should explore centralized secret scanning, Laravel-specific hardening guides, and secure-by-design patterns for managing .env files and container secrets across frameworks.
Found this article interesting? Follow us on Google News, Twitter and LinkedIn to read more exclusive content we post.
Text extracted automatically; images, tables and formatting may be missing. Original: https://thehackernews.com/2025/07/over-600-laravel-apps-exposed-to-remote.html