T09 · Insecure Skill Coding Practices
- Location
SKILL.md:66- Finding
OAuth credentials exposed through command-line arguments
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:66-73,SKILL.md:144-149, andSKILL.md:154-158
Vulnerability Type: Sensitive information exposure through process arguments
Risk Level: MediumThe documented commands expand OAuth authorization codes, client secrets, PKCE verifiers, and refresh tokens directly into
curlcommand-line arguments.bash curl -s -X POST "https://$AUTH_DOMAIN/oauth/token" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=authorization_code" \ -d "code=$AUTH_CODE" \ -d "redirect_uri=$REDIRECT_URI" \ -d "client_id=$CLIENT_ID" \ -d "client_secret=$CLIENT_SECRET" \ -d "code_verifier=$CODE_VERIFIER" | python3 -c "bash curl -s -X POST "https://$AUTH_DOMAIN/oauth/token" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials" \ -d "client_id=$CLIENT_ID" \ -d "client_secret=$CLIENT_SECRET" \ -d "audience=$API_AUDIENCE"bash curl -s -X POST "https://$AUTH_DOMAIN/oauth/token" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=refresh_token" \ -d "refresh_token=$REFRESH_TOKEN" \ -d "client_id=$CLIENT_ID"Technical Analysis
Shell variable expansion places the credential values in the argument list of the running
curlprocess. Depending on operating-system process isolation and the execution environment, these arguments may be visible through process-monitoring interfaces, diagnostic tools, endpoint monitoring, shell tracing, CI telemetry, or session recording.Supplying credentials to the selected OAuth token endpoint is necessary for the declared debugging function. Exposing those credentials through process arguments is not necessary, however, and exceeds the minimum disclosure required to conduct the request. Authorization codes and PKCE verifiers are short-lived, but client secrets and refresh tokens may remain valid for ...[truncated 1493 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not place client secrets, refresh tokens, authorization codes, or PKCE verifiers directly in process arguments.
- Read sensitive request values from a protected input channel, such as a temporary
curlconfiguration file with permissions set to0600, and securely delete the file immediately after use. - Prefer provider SDKs or a small audited helper that reads secrets from standard input or a protected credential store without exposing them in process metadata.
- Disable shell tracing with
set +xbefore handling credentials and ensure CI systems mask all OAuth-related variables. - Add explicit warnings against running the commands in shared terminals, recorded sessions, or untrusted CI runners.
- Use short-lived credentials and revoke or rotate any client secret or refresh token suspected of exposure.
- Verify
AUTH_DOMAINagainst an expected allowlist before transmitting credentials.
