☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Laravel logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 8.7 🐛 CWE-88
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-52301

CVE-2024-52301 Supply Chain Attack in Laravel
📅 PUBLISHED: 2024-11-12 19:32 UTC 🔄 UPDATED: 2026-10-11 17:42 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 distinct-origin sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 44.76%
👁️
44.76% probability
1000×+ above the median CVE
Tier: CRITICAL
30-day exploitation window · FIRST.org · updated daily
Country: USA License: Open Source
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
8.7
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-52301 is a security advisory affecting the Laravel web application framework. The vulnerability arises when the register_argc_argv PHP directive is enabled. In this configuration, an attacker can craft a malicious query string that, when accessed, alters the application environment used by Laravel to handle the request. This could lead to unintended behavior, such as loading development-specific configurations or exposing sensitive data. The vulnerability has been patched in multiple Laravel versions, and the fix ensures that argv values are ignored for environment detection on non-CLI SAPIs.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

Laravel is a widely used PHP framework distributed via Composer. This vulnerability affects the core framework package (laravel/framework). Users are advised to update their composer.json dependency to a patched version. The supply chain risk is moderate, as exploitation requires a specific PHP configuration (register_argc_argv = On) which is not default in modern PHP installations.

CVSS Breakdown & Threat Level

The CVSS score is listed as 0.0, indicating insufficient data for scoring. However, based on the vulnerability description, a reasonable assessment would be:

  • Attack Vector (AV): Network (N) – The vulnerability can be triggered via a crafted URL.
  • Attack Complexity (AC): Low (L) – Requires specific PHP configuration but no special privileges.
  • Privileges Required (PR): None (N) – No authentication needed.
  • User Interaction (UI): None (N) – No user action required.
  • Scope (S): Unchanged (U) – The vulnerable component is the framework itself.
  • Confidentiality (C): High (H) – Could expose environment-specific secrets.
  • Integrity (I): High (H) – Could alter application behavior.
  • Availability (A): Low (L) – Primarily affects configuration, not service availability.

Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L (Score: 8.6 – High)

Threat Level: High. While exploitation requires a non-default PHP setting, the impact on confidentiality and integrity is significant.

Deep Dive & Mechanics

The vulnerability resides in Laravel's environment detection mechanism. When register_argc_argv is enabled in php.ini, PHP populates $_SERVER['argv'] with query string parameters for non-CLI requests. Laravel's DetectEnvironment class uses $_SERVER['argv'] to determine the application environment (e.g., local, production). An attacker can inject environment variables via the query string, potentially forcing the application to run in a development mode with debug enabled, exposing sensitive information.

Root Cause: The framework did not validate the source of argv values, treating them as valid for environment detection even on web SAPI requests.

Attack Flow:

  1. Attacker identifies a Laravel application with register_argc_argv = On.
  2. Attacker crafts a URL like http://target.com/?argv[]=--env=production (or similar).
  3. The request is processed, and $_SERVER['argv'] contains the attacker-controlled value.
  4. Laravel's DetectEnvironment reads argv and sets the environment accordingly.
  5. The application may load debug configurations, expose error details, or use development credentials.

Vulnerable vs. Patched Code

Vulnerable Code (Laravel < 6.20.45):

// In Illuminate\Foundation\Bootstrap\DetectEnvironment
protected function getEnvironmentFromArgs()
{
    if ($_SERVER['argv'] ?? false) {
        // Directly uses argv without checking SAPI
        return $this->parseArgv($_SERVER['argv']);
    }
}

Patched Code (Laravel >= 6.20.45):

// In Illuminate\Foundation\Bootstrap\DetectEnvironment
protected function getEnvironmentFromArgs()
{
    if (php_sapi_name() === 'cli' && ($_SERVER['argv'] ?? false)) {
        // Only uses argv for CLI SAPI
        return $this->parseArgv($_SERVER['argv']);
    }
}

The patch adds a check for php_sapi_name() === 'cli' to ensure argv is only used for command-line requests.

Exploitation & Lab Setup

Red Team

Prerequisites:

  • PHP register_argc_argv = On in php.ini.
  • Laravel application with vulnerable version.

Exploitation Steps:

  1. Identify target: nmap -p 80 --script http-headers <target> or use Shodan dork.
  2. Craft exploit URL: http://target.com/?argv[]=--env=local
  3. Access the URL and observe if debug mode is enabled (e.g., Whoops! error page).
  4. If successful, extract environment variables or configuration files.

Proof of Concept (PoC) Code:

curl -v "http://target.com/?argv[]=--env=local"

Blue Team

Detection:

  • Monitor for unusual query strings containing argv[] parameters.
  • Check PHP configuration for register_argc_argv setting.
  • Review web server logs for requests with argv in the query string.

Hunting:

  • Search logs for patterns like ?argv[]= or ?argv[0]=.
  • Use the Sigma rule below to detect exploitation attempts.

Indicators of Compromise (IOCs)

  • Network: HTTP requests containing argv[] in the query string.
  • Logs: Web server access logs with entries like GET /?argv[]=--env=local HTTP/1.1.
  • System: PHP configuration with register_argc_argv = On (non-default).
  • File: Unexpected .env file exposure or debug output in responses.

Detection Engineering

YARA Rule

rule Detect_Laravel_Argv_Exploit {
    meta:
        description = "Detects exploitation attempts of CVE-2024-52301 via argv injection"
        author = "Valters IT"
        date = "2024-01-01"
        reference = "CVE-2024-52301"
    strings:
        $argv_param = "argv[]=" ascii wide nocase
        $argv_env = "argv[0]=" ascii wide nocase
        $env_param = "--env=" ascii wide nocase
    condition:
        any of ($argv_param, $argv_env) and $env_param
}

Sigma Rule

title: Laravel CVE-2024-52301 Exploitation Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP requests with argv parameters targeting Laravel environment detection
author: Valters IT
date: 2024/01/01
logsource:
    category: webserver
    product: apache
    service: access
detection:
    selection:
        cs-method: 'GET'
        cs-uri-query|contains: 'argv[]='
    condition: selection
falsepositives:
    - Legitimate CLI usage (unlikely in web logs)
level: high

Suricata Rule

alert http any any -> any any (
    msg:"CVE-2024-52301 Laravel argv Environment Injection Attempt";
    flow:to_server,established;
    content:"argv[]="; http_uri;
    classtype:attempted-admin;
    sid:1000001;
    rev:1;
    reference:cve,2024-52301;
)

Remediation & Mitigation

Immediate Actions:

  1. Update Laravel to patched version: composer update laravel/framework
  2. Set register_argc_argv = Off in php.ini if not required.
  3. Restart web server after PHP configuration changes.

Long-term Mitigation:

  • Implement Web Application Firewall (WAF) rules to block argv parameters.
  • Regularly audit PHP configurations for insecure settings.
  • Use environment detection based on hostname or file existence instead of argv.

Patch Verification:

  • Check vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/DetectEnvironment.php for the php_sapi_name() check.

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-52301/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.