GHSA-7mc6-x925-7qvx Test code in published microsoft-graph-beta package exposes phpinfo()
Published test code exposes phpinfo() if vendor directory is web-accessible, allowing attackers to read system configuration and secrets.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is GHSA-7mc6-x925-7qvx?
GHSA-7mc6-x925-7qvx is a vulnerability in microsoft/microsoft-graph-beta, published on 5 Dec 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Impact
The Microsoft Graph Beta PHP SDK published packages which contained test code that enabled the use of the phpInfo() function from any application that could access and execute the file at vendor/microsoft/microsoft-graph-beta/tests/GetPhpInfo.php. The phpInfo function exposes system information.
The vulnerability affects the GetPhpInfo.php script of the PHP SDK which contains a call to the phpinfo() function.
This vulnerability requires a misconfiguration of the server to be present so it can be exploited. For example, making the PHP application’s /vendor directory web accessible.
The combination of the vulnerability and the server misconfiguration would allow an attacker to craft an HTTP request that executes the phpinfo() method. The attacker would then be able to get access to system information like configuration, modules, and environment variables and later on use the compromised secrets to access additional data.
Patches
This problem has been patched in dependencies of version 2.0.1.
Workarounds
If an immediate deployment with the updated vendor package is not available, you can perform the following temporary workarounds:
- delete the vendor/microsoft/microsoft-graph-beta/tests/GetPhpInfo.php file
- remove access to the /vendor directory will remove this vulnerability
- disable the phpinfo function
References
For more information about the vulnerability and the patch, users can refer to the following sources:
- https://nvd.nist.gov/vuln/detail/CVE-2023-49103
- https://github.com/microsoftgraph/msgraph-beta-sdk-php/compare/2.0.0...2.0.1
- https://github.com/microsoftgraph/msgraph-sdk-php-core/compare/2.0.1...2.0.2
- https://github.com/microsoftgraph/msgraph-sdk-php/compare/1.109.0...1.109.1
- https://owncloud.com/security-advisories/disclosure-of-sensitive-credentials-and-configuration-in-containerized-deployments/
Which versions are affected by GHSA-7mc6-x925-7qvx?
2 open source packages ship an affected version, including microsoft/microsoft-graph-beta.
| Package | Affected | Fixed in |
|---|---|---|
microsoft/microsoft-graph-beta Packagist | All versions | 2.0.1 |
microsoft/microsoft-graph-beta Packagist | All versions | 2.0.1 |
How do I fix GHSA-7mc6-x925-7qvx?
Upgrade microsoft/microsoft-graph-beta to 2.0.1 or later.
Is GHSA-7mc6-x925-7qvx being exploited?
There is no known exploitation of GHSA-7mc6-x925-7qvx in the wild and no public exploit code.