CVE-2022-39304: Github.com/bradleyfalzon/ghinstallation Ghinstallation Returns App JWT Vulnerability

MODERATE
Advisory Identifier: GHSA-h4q8-96p6-jcgr
CVSS 5.0
CWE-209
Published
Advisory Summary

CVE-2022-39304 is a MODERATE (CVSS 5.0) ghinstallation returns app jwt vulnerability (CWE-209: Generation of Error Message Containing Sensitive Information) affecting Github.com/bradleyfalzon/ghinstallation libraries in the Go ecosystem. The issue involves ghinstallation returns app jwt in error responses. Remediation is available by upgrading affected packages to version 2.0.0.

CVE-2022-39304 at a Glance

CVE Identifier CVE-2022-39304
GHSA Identifier GHSA-h4q8-96p6-jcgr
Severity MODERATE
CVSS v3.1 Base Score 5.0
CWE Classification CWE-209: Generation of Error Message Containing Sensitive Information
Affected Product Github.com/bradleyfalzon/ghinstallation
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.0

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

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

How to Fix CVE-2022-39304

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

github.com/bradleyfalzon/ghinstallation fixed: 2.0.0
Upgrade github.com/bradleyfalzon/ghinstallation to 2.0.0
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 github.com/bradleyfalzon/ghinstallation

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-39304, inspect your project dependencies for Github.com/bradleyfalzon/ghinstallation:

inspect dependencies for github.com/bradleyfalzon/ghinstallation

Analyze the terminal output to locate any version of Github.com/bradleyfalzon/ghinstallation in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.0), 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 Github.com/bradleyfalzon/ghinstallation, 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 In ghinstallation v1, when the request to refresh an installation token failed, the HTTP request and response would be returned for debugging. https://github.com/bradleyfalzon/ghinstallation/blob/24e56b3fb7669f209134a01eff731d7e2ef72a5c/transport.go#L172-L174 The request contained the bearer JWT for the App, and was returned back to clients. This token is short lived (10 minute maximum). ### Patches - This has already been patched in d24f14f8be70d94129d76026e8b0f4f9170c8c3e, and is available in releases >= v2.0.0. ### References _Are there any links users can visit to find out more?_ - See https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-an-installation for the App installation flow. ### For more information If you have any questions or comments about this advisory: * Open an issue in [ghinstallation](https://github.com/bradleyfalzon/ghinstallation)

CVE-2022-39304 Affected Github.com/bradleyfalzon/ghinstallation Versions

1 component(s)
Fixed Versions:
2.0.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/bradleyfalzon/ghinstallation
Go
< 2.0.0
2.0.0

References

Frequently Asked Questions

What is CVE-2022-39304?
CVE-2022-39304 is a security vulnerability in Github.com/bradleyfalzon/ghinstallation involving ghinstallation returns app JWT in error responses under CWE-209: Generation of Error Message Containing Sensitive Information.
Which Github.com/bradleyfalzon/ghinstallation versions are affected?
Affected versions include releases prior to 2.0.0 across affected packages: github.com/bradleyfalzon/ghinstallation.
What version fixes CVE-2022-39304?
Upgrading to 2.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/bradleyfalzon/ghinstallation affected?
Yes, github.com/bradleyfalzon/ghinstallation is affected in releases prior to 2.0.0. Upgrade your dependency to 2.0.0 or later.
What is the CVSS score of CVE-2022-39304?
CVE-2022-39304 has a CVSS v3.1 base score of 5.0 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:N/A:L.
What CWE is associated with CVE-2022-39304?
CVE-2022-39304 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 Go dependencies for CVE-2022-39304?
Run the dependency tree command: 'inspect dependencies for github.com/bradleyfalzon/ghinstallation'. 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-h4q8-96p6-jcgr",
  "modified" : "2022-12-19T22:48:32Z",
  "published" : "2022-12-19T22:48:32Z",
  "aliases" : [ "CVE-2022-39304" ],
  "summary" : "ghinstallation returns app JWT in error responses",
  "details" : "### Impact\n\nIn ghinstallation v1, when the request to refresh an installation token failed, the HTTP request and response would be returned for debugging.\n\nhttps://github.com/bradleyfalzon/ghinstallation/blob/24e56b3fb7669f209134a01eff731d7e2ef72a5c/transport.go#L172-L174\n\nThe request contained the bearer JWT for the App, and was returned back to clients. This token is short lived (10 minute maximum).\n\n### Patches\n\n- This has already been patched in d24f14f8be70d94129d76026e8b0f4f9170c8c3e, and is available in releases >= v2.0.0.\n\n### References\n_Are there any links users can visit to find out more?_\n\n- See https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-an-installation for the App installation flow.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [ghinstallation](https://github.com/bradleyfalzon/ghinstallation)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/bradleyfalzon/ghinstallation"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/bradleyfalzon/ghinstallation/security/advisories/GHSA-h4q8-96p6-jcgr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39304"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bradleyfalzon/ghinstallation/commit/d24f14f8be70d94129d76026e8b0f4f9170c8c3e"
  }, {
    "type" : "WEB",
    "url" : "https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-an-installation"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bradleyfalzon/ghinstallation"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bradleyfalzon/ghinstallation/blob/24e56b3fb7669f209134a01eff731d7e2ef72a5c/transport.go#L172-L174"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-1178"
  }, {
    "type" : "ADVISORY",
    "url" : "https://securitylab.github.com/advisories/GHSL-2022-061_ghinstallation"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-209" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-12-19T22:48:32Z",
    "nvd_published_at" : "2022-12-20T20:15:00Z"
  }
}