T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/authorize-outlook.sh:6
- Finding
- Hard-Coded Outlook OAuth Client Secret<![CDATA[ ## Vulnerability Details **File Location**: `scripts/authorize-outlook.sh:6-9`; duplicated in `README.md:30-35` and `README.md:109-115` **Vulnerability Type**: Hard-coded reusable 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 also published in the project documentation and example configuration. ### Technical Analysis A live-looking, reusable OAuth client secret is embedded directly in the distributed Skill. Anyone who can download the package, inspect its documentation, or access its source history can recover the credential. The shell wrapper also passes the secret as a command-line argument. Depending on the operating system and execution environment, command-line arguments may be exposed through process inspection, audit logs, shell tracing, monitoring tools, or diagnostic reports. Although an OAuth client secret does not independently provide mailbox access, it authenticates the application during authorization-code exchange and token refresh. Its disclosure destroys the confidentiality expected of a confidential-client credential and can facilitate application impersonation or OAuth-flow abuse. ### Attack Path 1. An attacker downloads or otherwise obtains the Skill package. 2. The attacker extracts the client secret, client ID, and tenant ID from `authorize-outlook.sh` or `README.md`. 3. The attacker configures a client that impersonates the distributed OAuth application. 4. The attacker combines the exposed credential with authorization codes, refresh tokens, redirect-flow weaknesses, or social engineering to perform token exchanges as that application. 5. The compromised application credential remains usable until revoked or expired. ...[truncated 553 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Revoke and rotate the exposed Azure client secret immediately. 2. Remove the secret from the shell script, README, example configuration, release artifacts, and repository history. 3. Require each operator to register or supply their own OAuth application credentials. 4. Load confidential values from protected environment variables, an operating-system secret manager, or an owner-readable configuration file. 5. Do not pass secrets through command-line arguments. Read them from the environment, a protected file descriptor, or an interactive secret prompt. 6. Add automated secret scanning to the release and commit process. 7. Review authorization and token logs for historical use of the exposed application credential. ]]>
