CVE-2022-39304 ghinstallation returns app JWT in error responses

Medium 5.0 Published Updated

An attacker can obtain short-lived GitHub App JWTs from error responses in the ghinstallation Go library, potentially allowing unauthorized API access.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2022-39304?

CVE-2022-39304 is a medium-severity vulnerability in bradleyfalzon ghinstallation, published on 20 Dec 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-209

Which versions are affected by CVE-2022-39304?

3 open source packages ship an affected version, including github.com/bradleyfalzon/ghinstallation. It affects 1 product.

PackageAffectedFixed in
github.com/bradleyfalzon/ghinstallation GoAll versions1.1.2-0.20210308182858-d24f14f8be70
github.com/bradleyfalzon/ghinstallation GoAll versions2.0.0
github.com/bradleyfalzon/ghinstallation GoAll versions2.0.0

Products include Ghinstallation Project Ghinstallation.

How do I fix CVE-2022-39304?

Upgrade github.com/bradleyfalzon/ghinstallation to a fixed version for your release line: 1.1.2-0.20210308182858-d24f14f8be70 or 2.0.0.

Is CVE-2022-39304 being exploited?

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

Sources

Also known as GHSA-h4q8-96p6-jcgr, GO-2022-1178.

Is CVE-2022-39304 in your software?

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

Check your SBOMs for free