/

CVE-2026-66902

Severity:

CRITICAL RISK

(9.8)

OS Command Injection (CWE-78) in Google::Auth Perl Library

CVE-2026-66902

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78, CWE-829

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Google::Auth for Perl can execute a command specified in an external-account credentials JSON file without requiring an explicit opt-in. When an application loads credentials from a configuration it does not fully control, an attacker may achieve operating-system command execution with the application's privileges.

Affected context

The issue affects Google::Auth configurations that use the external-account credential flow with a credential_source.executable entry. The executable command and environment variables are read from the credentials JSON, and the command is invoked without a user-controlled safety gate. Configurations without this executable credential source do not select the affected code path.

Exploit preconditions

  • Attack surface: Application Default Credentials processing through Google::Auth
  • Required access: Ability to supply, alter, or influence the credentials JSON consumed by the application
  • Trigger point: Credential construction when an external-account configuration contains credential_source.executable
  • Why exploitation is possible: The configured command is passed to a shell through a single-argument system call, while attacker-influenced environment variables are copied into the process environment

Why this happens

The vulnerability results from treating a command supplied through an external configuration file as executable functionality without an explicit security boundary or opt-in control. A single-argument system invocation delegates interpretation of the complete string to /bin/sh, allowing command syntax in the configuration to affect process execution. This maps primarily to CWE-78: Improper Neutralization of Special Elements used in an OS Command, with CWE-829: Inclusion of Functionality from Untrusted Control Sphere also relevant because executable behavior is sourced from externally controlled configuration.

Potential impact

  • An attacker may execute operating-system commands as the application process
  • Application credentials, tokens, and locally accessible data could be exposed
  • The host or container may be modified or used for persistence
  • Compromised execution could enable lateral movement or supply-chain abuse

General mitigation guidance

Mitigation generally focuses on preventing configuration data from defining executable behavior and reducing trust in external credential files.

Common defensive patterns include:

  • Disable executable credential sources unless they are explicitly required and independently approved
  • Use credential flows that contain data rather than commands
  • Treat credential configuration as security-sensitive, immutable input
  • Apply strict schema and policy validation that rejects executable entries and unexpected environment variables
  • Avoid shell-mediated command construction; where a narrowly defined subprocess is necessary, use a fixed executable and an argument array
  • Run applications with least privilege and isolate credential-processing workloads
  • Restrict access to credential files, environment variables, and application identities

How teams detect issues like this

Organizations can identify this class of issue through:

  • Static analysis rules for single-string system calls and other shell-spawning APIs
  • Code review checks for command, executable, or environment-variable fields sourced from configuration
  • Repository and deployment scans for external-account JSON containing credential_source.executable
  • Policy enforcement that rejects credential configurations capable of launching arbitrary processes
  • Runtime monitoring for unexpected child processes, shell invocation, or unusual environment changes during authentication

Automated code review and software composition analysis tools may help surface unsafe command-execution patterns.

Sources

SourceLink
github.comgithub.com/GoogleCloudPlatform/google-auth-library-perl/commit/c95c77e70bec94f17e239d88050f843ea1cade95.patch
metacpan.orgmetacpan.org/release/CJCOLLIER/Google-Auth-0.06/diff/CJCOLLIER/Google-Auth-0.05
openwall.comopenwall.com/lists/oss-security/2026/08/04/35

Frequently asked

questions

It can be exploitable through a remote or indirect configuration-delivery path when an application consumes attacker-influenced credentials JSON. Direct network reachability to Google::Auth is not required if the attacker can alter the configuration source.

The attacker must be able to supply, modify, or cause the application to consume a credentials configuration containing an executable external-account source. The resulting command runs with the application's operating-system privileges.

Prevent credential configuration from selecting arbitrary executables. Prefer non-executable credential mechanisms and, where subprocesses are unavoidable, use fixed allowlisted programs with structured arguments rather than shell-parsed strings.

Treat authentication configuration as trusted security policy, validate it before use, prohibit command-bearing fields by default, restrict file access, and monitor authentication components for unexpected process creation.

Find out what's already
exploitable in your codebase.