CVE-2018-15133 — Laravel Deserialization of Untrusted Data Vulnerability

CVE-2018-15133

If an attacker has the app's APP_KEY, forged encrypted cookies deserialize into remote code execution on Laravel apps

What is Laravel?

Laravel is one of the most widely used open-source PHP web application frameworks, powering everything from small business sites to large-scale enterprise applications. It provides built-in mechanisms for encrypting cookies, session data, and other application state using a secret application key (APP_KEY), which is intended to keep that data confidential and tamper-proof from end users' browsers.

Overview

CVE-2018-15133 is a deserialization of untrusted data vulnerability in Laravel's decryption/unserialize handling. If an attacker obtains a copy of an application's APP_KEY — through leaked .env files, source code exposure, misconfigured debug pages, or other means — they can forge encrypted values (such as cookies) that, when decrypted and unserialized by the application, execute a PHP object injection gadget chain, resulting in remote code execution.

Technical Details

The flaw (CWE-502, Deserialization of Untrusted Data) exists because Laravel's cookie/session decryption path unserializes decrypted values without further validating that they are safe, benign data structures. Because PHP's native unserialize() can be abused via "gadget chains" present in the application's own class hierarchy (or third-party libraries it includes) to trigger arbitrary method calls during object construction/destruction, an attacker who can produce a validly-encrypted payload — which requires knowledge of APP_KEY — can achieve code execution purely by having that cookie processed by the application. This is why the vulnerability is scored high (CVSS 8.1) but conditioned on the attacker already possessing the encryption key, a real-world scenario given how often .env files or environment configuration leak via misconfigured servers, source control exposure, or other vulnerabilities.

Discovery

The vulnerability and fix were addressed by the Laravel core team in the framework's own release process; version 5.6.30 was published with the corrected decryption/unserialize handling.

Exploitation Context

CISA's KEV entry confirms real-world exploitation. In practice, attackers typically obtain the APP_KEY through a separate initial vulnerability or misconfiguration (e.g., an exposed .env file, a debug mode information disclosure, or a separate source-code leak) and then use it to weaponize this deserialization bug for full remote code execution — making it a common second-stage exploit in intrusion chains against Laravel-based applications rather than a fully independent, no-prerequisite vulnerability.

Remediation

  1. Upgrade to Laravel 5.6.30 or later, which fixes the unsafe deserialization behavior.
  2. Treat any APP_KEY exposure as a critical incident: rotate the key immediately if there is any suspicion it has leaked (exposed .env file, source control leak, debug page disclosure, etc.).
  3. Ensure .env files and other files containing APP_KEY are never web-accessible and are excluded from version control.
  4. Disable debug mode (APP_DEBUG=false) in production to reduce the risk of key or configuration disclosure.
  5. Monitor for unusual application errors or crashes tied to cookie/session decryption, which can indicate deserialization exploitation attempts.

Key Details

PropertyValue
CVE ID CVE-2018-15133
Vendor / Product Laravel — Laravel Framework
NVD Published2018-08-09
NVD Last Modified2025-11-07
CVSS 3.1 Score8.1
CVSS 3.1 VectorCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
SeverityHIGH
CWE CWE-502 find similar ↗
CISA KEV Added2024-01-16
CISA KEV Deadline2024-02-06
Known Ransomware Use No

CVSS 3.1 Breakdown

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Required Action

CISA BOD 22-01 Deadline: 2024-02-06. Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.

Timeline

DateEvent
2018-08-09CVE published; Laravel 5.6.30 released addressing the deserialization issue
2024-01-16Added to CISA Known Exploited Vulnerabilities catalog
2024-02-06CISA BOD 22-01 remediation deadline

References

ResourceType
NVD — CVE-2018-15133 Vulnerability Database
CISA KEV Catalog Entry US Government
Laravel 5.6.30 Upgrade Guide Vendor Advisory