The vulnerability allows for arbitrary file reads due to improper validation of file paths in the bulk user import feature. The investigation started by analyzing the provided commit for auth0/symfony, which revealed a dependency update for auth0/auth0-php. This indicated the vulnerability was in the underlying auth0/auth0-php library.
By comparing the git tags of auth0/auth0-php between the last vulnerable version (8.16.0) and the first patched version (8.17.0), I identified the commit that introduced the security fix. The commit 47555b615b3c5f324cdf1cecbeca8de990b92594 contains the relevant changes.
The analysis of the commit diffs revealed two key functions:
-
Auth0\SDK\Utility\HttpRequest::addFile: This function is the primary entry point for the vulnerability. Before the patch, it accepted a file path from the user and added it to the request without any validation. This is where an attacker would supply a malicious path (e.g., using a php:// wrapper).
-
Auth0\SDK\Utility\Assert::fileExists: This function was modified as part of the fix. The patch added a check to reject any file path containing ://, which prevents the use of PHP stream wrappers for remote or filtered file access. The vulnerability existed because HttpRequest::addFile relied on this function (and others) which did not perform this crucial validation.
Therefore, during exploitation, a profiler would show Auth0\SDK\Utility\HttpRequest::addFile being called with a malicious file path. This function, in turn, would have called the older, insecure version of Auth0\SDK\Utility\Assert::fileExists.