GHSA-7mc6-x925-7qvx Test code in published microsoft-graph-beta package exposes phpinfo()

Not scored Published

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:

Which versions are affected by GHSA-7mc6-x925-7qvx?

2 open source packages ship an affected version, including microsoft/microsoft-graph-beta.

PackageAffectedFixed in
microsoft/microsoft-graph-beta PackagistAll versions2.0.1
microsoft/microsoft-graph-beta PackagistAll versions2.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.

Sources

Is GHSA-7mc6-x925-7qvx in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free