Miggo Logo

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

5

CVSS Score
3.1

Basic Information

EPSS Score
0.08079%
Published
12/19/2022
Updated
8/28/2023
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:N/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/bradleyfalzon/ghinstallationgo< 2.0.02.0.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stemmed from error handling in the refreshToken method where fmt.Errorf was used with verbose request/response details. The pre-patch line (return fmt.Errorf("request %+v received non 2xx response status %q with body %+v and TLS %+v", ...)) included the HTTP request object containing the JWT in headers. The commit d24f14f specifically modified this error formatting to remove sensitive request details, confirming this function as the vulnerability source. The Transport.refreshToken function is directly responsible for handling authentication token refreshes and error reporting, making it the clear entry point for the sensitive data leak.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t In **inst*ll*tion v*, w**n t** r*qu*st to r**r*s* *n inst*ll*tion tok*n **il**, t** *TTP r*qu*st *n* r*spons* woul* ** r*turn** *or ***u**in*. *ttps://*it*u*.*om/*r**l*y**lzon/**inst*ll*tion/*lo*/****************************************/

Reasoning

T** vuln*r**ility st*mm** *rom *rror **n*lin* in t** `r**r*s*Tok*n` m*t*o* w**r* `*mt.*rror*` w*s us** wit* v*r*os* r*qu*st/r*spons* **t*ils. T** pr*-p*t** lin* (r*turn `*mt.*rror*`("r*qu*st %+v r***iv** non *xx r*spons* st*tus %q wit* *o*y %+v *n* T