CVE-2022-39304
JSON

5.0medium

ghinstallation returns app JWT in error responses

Severity
5.0medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.35% (higher than 21% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-h4q8-96p6-jcgrGO-2022-1178

Description

ghinstallation provides transport, which implements http.RoundTripper to provide authentication as an installation for GitHub Apps. In ghinstallation version 1, when the request to refresh an installation token failed, the HTTP request and response would be returned for debugging. The request contained the bearer JWT for the App, and was returned back to clients. This token is short lived (10 minute maximum). This issue has been patched and is available in version 2.0.0.

Affected

Product or packageVersionsReported by
bradleyfalzon ghinstallation< 2.0.0CVE List
github.com/bradleyfalzon/ghinstallation (Go)before 2.0.0, before 1.1.2-0.20210308182858-d24f14f8be70GitHub Advisory Database, Go Vulnerability Database
ghinstallation_project ghinstallationbefore 2.0.0NVD

All scores

GitHub_M5.0medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:N/A:L
GitHub5.0medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:N/A:L
NVD4.7medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N

Classification

CWE-209

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

ghinstallation provides transport, which implements http.RoundTripper to provide authentication as an installation for GitHub Apps. In ghinstallation version 1, when the request to refresh an installation token failed, the HTTP request and response would be returned for debugging. The request contained the bearer JWT for the App, and was returned back to clients. This token is short lived (10 minute maximum). This issue has been patched and is available in version 2.0.0.

GitHub Advisory Database
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?

For more information

If you have any questions or comments about this advisory:

Go Vulnerability Database

Errors returned by ghinstallation.Transport can include the JWT used for the failed operation. If the error is exposed to an untrusted party, this JWT could be extracted and used to authenticate further requests.

NVD (es)

ghinstallation proporciona transporte, que implementa http.RoundTripper para proporcionar autenticación como una instalación para GitHub Apps. En la versión 1 de ghinstallation, cuando fallaba la solicitud para actualizar un token de instalación, la solicitud HTTP y la respuesta se devolvían para su depuración. La solicitud contenía el JWT portador de la aplicación y se devolvía a los clientes. Este token tiene una duración breve (máximo 10 minutos). Este problema ha sido solucionado y está disponible en la versión 2.0.0.

References

https://github.com/bradleyfalzon/ghinstallation/security/advisories/GHSA-h4q8-96p6-jcgradvisory, patch, third-party-advisory, web
https://github.com/bradleyfalzon/ghinstallation/commit/d24f14f8be70d94129d76026e8b0f4f9170c8c3efix, patch, third-party-advisory, web
https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-an-installationtechnical-description, third-party-advisory, web
https://github.com/bradleyfalzon/ghinstallation/blob/24e56b3fb7669f209134a01eff731d7e2ef72a5c/transport.go#L172-L174exploit, third-party-advisory, web
https://nvd.nist.gov/vuln/detail/CVE-2022-39304advisory
https://github.com/bradleyfalzon/ghinstallationpackage
https://pkg.go.dev/vuln/GO-2022-1178web
https://securitylab.github.com/advisories/GHSL-2022-061_ghinstallationadvisory

Sources

SourceRecordLicence
CVE ListCVE-2022-39304 changed 2025-04-16CVE Terms of Use
GitHub Advisory DatabaseGHSA-h4q8-96p6-jcgr changed 2023-11-08CC-BY-4.0
Go Vulnerability DatabaseGO-2022-1178 changed 2024-05-20CC-BY-4.0
NVDCVE-2022-39304 changed 2026-06-17Public domain