The vulnerability lies in the auth0/auth0-php SDK's handling of file uploads, specifically within the bulk user import feature. The root cause is insufficient validation of file paths provided by the user.
The analysis of the security patch 9026da58f5c381cd4cb5932de829eff6eacbb65c reveals two key functions involved:
-
Auth0\SDK\Utility\HttpRequest::addFile: This is the primary vulnerable function. Before the patch, it accepted a file path and added it to the request payload without any validation. This allowed an attacker to provide a malicious path, such as a URL (http://..., file://...) or a PHP stream wrapper (php://filter/...), which the underlying HTTP client would then access. This could lead to arbitrary file reads on the server. The fix involves adding calls to Assert::fileExists() and Assert::readable() to ensure the path points to a valid, readable, and local file.
-
Auth0\SDK\Utility\Assert::fileExists: This function was hardened as part of the fix. The patch added a check to explicitly disallow paths containing ://. This prevents the use of URL-based paths and stream wrappers. While the main vulnerability was that addFile didn't call any validation function, the weakness in fileExists was a contributing factor that would have made simpler validation attempts insufficient.
During exploitation, a call to a high-level SDK function for bulk user import would eventually trigger a call to Auth0\SDK\Utility\HttpRequest::addFile with a malicious file path. Therefore, this function is a critical indicator that would appear in a runtime profile or stack trace when the vulnerability is exploited.