Summary
Google::Auth versions before 0.09 can perform server-side request forgery when credential configuration contains attacker-controlled URLs. An application that builds credentials from insufficiently trusted JSON may send tokens, secrets, or assertions to internal services, metadata endpoints, or other hosts selected by that configuration.
Affected context
The vulnerability occurs in Google::Auth credential flows that obtain request destinations from JSON configuration, including external account, authorized user, impersonated service account, and service account configurations. It becomes risky when an application processes credentials JSON that an untrusted party can supply or modify and the library does not adequately constrain configured URLs to an approved Google universe domain.
Exploit preconditions
- Attack surface: Credential creation and token-exchange HTTP requests in the Google::Auth Perl library
- Required access: Ability to provide or influence credentials JSON, or cause an application to process attacker-selected configuration
- Trigger point: Retrieval of subject tokens, token exchange, token refresh, or service-account impersonation
- Why exploitation is possible: Request URLs are read from configuration without consistently validating their hosts, allowing requests from the application's network position to attacker-selected destinations while carrying credentials associated with the request
Why this happens
The underlying bug is insufficient validation of URL destinations obtained from credential configuration. Several credential flows trusted JSON-supplied token, impersonation, or credential-source URLs and attached sensitive headers or request bodies before establishing that the destination belonged to an approved domain. This maps primarily to CWE-918, Server-Side Request Forgery, and can also expose sensitive information through unintended outbound requests, consistent with CWE-201, Exposure of Sensitive Information Through Sent Data.
Potential impact
- An attacker may cause requests to internal services or link-local metadata endpoints.
- Client secrets, refresh tokens, source access tokens, or other credentials could be disclosed.
- The application may access network resources that are not directly reachable by the attacker.
- Internal services could receive authenticated or otherwise sensitive requests.
- Cloud credentials or metadata responses could enable further compromise.
- Service-account assertions may have audience restrictions and may not be replayable against Google, but their disclosure could still increase exposure.
General mitigation guidance
Mitigation generally focuses on making credential destinations trusted by
default and reducing the influence of untrusted configuration.
Common defensive patterns include:
- Allowing requests only to explicitly approved hosts and schemes.
- Validating every configured URL before any network request or credential attachment occurs.
- Treating custom universe domains as an explicit, separately authorized deployment option rather than trusting a JSON-supplied value.
- Keeping credential configuration immutable and outside attacker-controlled input paths.
- Separating credential acquisition from arbitrary user-provided configuration.
- Restricting outbound network access with egress policies and blocking metadata endpoints where appropriate.
- Applying least privilege to the credentials used by the application.
- Avoiding transmission of secrets unless the destination and request purpose have been independently validated.
How teams detect issues like this
Detection approaches may include:
- Static analysis for HTTP requests whose destinations originate from parsed JSON or other externally controlled configuration.
- Review rules identifying credential-bearing headers or bodies combined with configurable URLs.
- Code review checks for missing scheme, hostname, allowlist, or approved-universe validation before network access.
- Runtime monitoring of credential-related requests to private, link-local, unexpected, or non-approved domains.
- Egress policy alerts for access to cloud metadata services and internal address ranges.
- Automated security review tools can help identify URL trust-boundary violations and sensitive data sent to configurable destinations.

