T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/authorize-outlook.sh:5
- Finding
- Hard-Coded Azure OAuth Client Secret<![CDATA[ ## Vulnerability Details **File Location**: `scripts/authorize-outlook.sh:5-10` **Additional Locations**: `README.md:124-130`, `README.md:372-378` **Vulnerability Type**: Hard-coded OAuth application credential **Risk Level**: High ### Vulnerable Code ```bash python3 authorize.py outlook \ --client-id "0360031a-ad0e-4bce-9d2f-0c53eda894b8" \ --client-secret "914fb58f-4aea-4ddb-bb97-51d66581cfee" \ --tenant-id "40a99b83-a343-41ca-b303-3e122965a6d8" \ --name "outlook_live" ``` The same client ID, client secret, and tenant ID are reproduced in the README configuration examples. ### Technical Analysis A live-looking Azure OAuth client secret is embedded directly in an executable shell script and published in project documentation. A client secret is an authentication credential for the registered OAuth application and must not be distributed with client-side software. The shell launcher additionally passes the secret as a command-line argument. On systems where process arguments are visible to other users or monitoring software, the secret may be exposed through process listings, audit logs, shell tracing, or process inspection interfaces. Removing the value from the current files is insufficient if the project has already been distributed or committed to version control, because copies may remain in package archives and repository history. ### Attack Path 1. An attacker downloads the Skill package or reads its repository. 2. The attacker extracts the Azure client ID, tenant ID, and client secret from the shell script or README. 3. The attacker submits the exposed application credentials to compatible Microsoft OAuth endpoints. 4. Depending on the Azure application registration, configured permissions, redirect URIs, and tenant policy, the attacker may impersonate or abuse the registered OAuth client. 5. The attacker may also combine the credential with stolen authorization codes or refresh tokens associated with the application. ### Im ...[truncated 507 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Revoke the exposed Azure client secret immediately and create a replacement only if a confidential client is genuinely required. 2. Remove the secret from the shell script, README, package releases, examples, and version-control history. 3. Load confidential values from protected environment variables, a secret manager, or a configuration file with restrictive permissions. 4. Do not pass secrets through command-line arguments. Read them through protected process input or a secret-management API. 5. Prefer an OAuth public-client flow with Authorization Code and PKCE for locally installed command-line applications, avoiding a distributable client secret. 6. Add automated secret scanning to development and release workflows. 7. Review Azure sign-in and application audit logs for use of the exposed credential. ]]>
