CVE-2023-37260 league/oauth2-server key exposed in exception message when passing as string and providing invalid pass phrase

High 8.2 Published Updated

Attackers can view private keys in exception messages if keys are passed as strings without valid passphrases in this PHP OAuth2 library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2023-37260?

CVE-2023-37260 is a high-severity vulnerability in thephpleague oauth2-server, published on 6 Jul 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

league/oauth2-server is an implementation of an OAuth 2.0 authorization server written in PHP. Starting in version 8.3.2 and prior to version 8.5.3, servers that passed their keys to the CryptKey constructor as as string instead of a file path will have had that key included in a LogicException message if they did not provide a valid pass phrase for the key where required. This issue has been patched so that the provided key is no longer exposed in the exception message in the scenario outlined above. Users should upgrade to version 8.5.3 to receive the patch. As a workaround, pass the key as a file instead of a string.

Weakness: CWE-209

Which versions are affected by CVE-2023-37260?

4 open source packages ship an affected version, including league/oauth2-server. It affects 1 product.

PackageAffectedFixed in
league/oauth2-server PackagistFrom 8.3.28.4.2
league/oauth2-server PackagistFrom 8.3.28.4.2
league/oauth2-server PackagistFrom 8.5.08.5.3
league/oauth2-server PackagistFrom 8.5.08.5.3

Products include Thephpleague Oauth2-Server.

How do I fix CVE-2023-37260?

Upgrade league/oauth2-server to a fixed version for your release line: 8.4.2 or 8.5.3.

Is CVE-2023-37260 being exploited?

There is no known exploitation of CVE-2023-37260 in the wild and no public exploit code.

Sources

Also known as GHSA-wj7q-gjg8-3cpm.

Is CVE-2023-37260 in your software?

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

Check your SBOMs for free