CVE-2023-37260: League/oauth2 server League/oauth2-server Key Exposed Vulnerability

HIGH
Advisory Identifier: GHSA-wj7q-gjg8-3cpm
CVSS 8.2
CWE-209 CWE-200
Published
Advisory Summary

CVE-2023-37260 is a HIGH (CVSS 8.2) league/oauth2-server key exposed vulnerability (CWE-209: Generation of Error Message Containing Sensitive Information) affecting League/oauth2 server libraries in the Packagist ecosystem. The issue involves league/oauth2-server key exposed in exception message when passing as a string and providing an invalid pass phrase. Remediation is available by upgrading affected packages to version 8.4.2, 8.5.3.

CVE-2023-37260 at a Glance

CVE Identifier CVE-2023-37260
GHSA Identifier GHSA-wj7q-gjg8-3cpm
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-209: Generation of Error Message Containing Sensitive Information
Affected Product League/oauth2 server
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2023-37260

To remediate this vulnerability, upgrade all affected League/oauth2 server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

league/oauth2-server fixed: 8.4.2
Upgrade league/oauth2-server to 8.4.2
league/oauth2-server fixed: 8.5.3
Upgrade league/oauth2-server to 8.5.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for league/oauth2-server

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-37260, inspect your project dependencies for League/oauth2 server:

inspect dependencies for league/oauth2-server

Analyze the terminal output to locate any version of League/oauth2 server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.4.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-209: Generation of Error Message Containing Sensitive Information, where the product generates an error message that includes sensitive information about its environment, users, or associated data. In League/oauth2 server, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact 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. ### Patches 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 or 8.4.2 to receive the patch. ### Workarounds We recommend upgrading the oauth2-server to one of the patched releases (8.5.3 or 8.4.2). If you are unable to upgrade you can avoid this security issue by passing your key as a file instead of a string. ### References * [Fix for 8.4.x](https://github.com/thephpleague/oauth2-server/pull/1359) * [Fix for 8.5.x](https://github.com/thephpleague/oauth2-server/pull/1353)

CVE-2023-37260 Affected League/oauth2 server Versions

2 component(s)
Fixed Versions:
8.4.28.5.3
Product / Package Ecosystem Affected Versions Fixed Version
league/oauth2-server
Packagist
≥ 8.3.2
< 8.4.2
8.4.2
league/oauth2-server
Packagist
≥ 8.5.0
< 8.5.3
8.5.3

References

Frequently Asked Questions

What is CVE-2023-37260?
CVE-2023-37260 is a security vulnerability in League/oauth2 server involving league/oauth2-server key exposed in exception message when passing as a string and providing an invalid pass phrase under CWE-209: Generation of Error Message Containing Sensitive Information.
Which League/oauth2 server versions are affected?
Affected versions include releases prior to 8.4.2, 8.5.3 across affected packages: league/oauth2-server.
What version fixes CVE-2023-37260?
Upgrading to 8.4.2, 8.5.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is league/oauth2-server affected?
Yes, league/oauth2-server is affected in releases prior to 8.4.2, 8.5.3. Upgrade your dependency to 8.4.2, 8.5.3 or later.
What is the CVSS score of CVE-2023-37260?
CVE-2023-37260 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2023-37260?
CVE-2023-37260 is classified under CWE-209: Generation of Error Message Containing Sensitive Information (The product generates an error message that includes sensitive information about its environment, users, or associated data.).
How can I check Packagist dependencies for CVE-2023-37260?
Run the dependency tree command: 'inspect dependencies for league/oauth2-server'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-wj7q-gjg8-3cpm",
  "modified" : "2023-08-03T16:56:42Z",
  "published" : "2023-07-06T21:07:27Z",
  "aliases" : [ "CVE-2023-37260" ],
  "summary" : "league/oauth2-server key exposed in exception message when passing as a string and providing an invalid pass phrase",
  "details" : "### Impact\nServers 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. \n\n### Patches\nThis 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 or 8.4.2 to receive the patch.\n\n### Workarounds\nWe recommend upgrading the oauth2-server to one of the patched releases (8.5.3 or 8.4.2). If you are unable to upgrade you can avoid this security issue by passing your key as a file instead of a string.\n\n### References\n* [Fix for 8.4.x](https://github.com/thephpleague/oauth2-server/pull/1359)\n* [Fix for 8.5.x](https://github.com/thephpleague/oauth2-server/pull/1353)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "league/oauth2-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.3.2"
      }, {
        "fixed" : "8.4.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "league/oauth2-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.5.0"
      }, {
        "fixed" : "8.5.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/thephpleague/oauth2-server/security/advisories/GHSA-wj7q-gjg8-3cpm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-37260"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/thephpleague/oauth2-server/pull/1353"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/thephpleague/oauth2-server/pull/1359"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/thephpleague/oauth2-server"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/thephpleague/oauth2-server/releases/tag/8.5.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-209" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-06T21:07:27Z",
    "nvd_published_at" : "2023-07-06T16:15:10Z"
  }
}