T09 · Insecure Skill Coding Practices
- Location
SKILL.md:30- Finding
OAuth Secrets and Authorization Callback Exposed Through Chat and Plaintext Workspace Storage
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 30-37
Vulnerability Type: Sensitive credential exposure and insecure secret storage
Risk Level: HighVulnerable Instructions:
text 1. **Ask for `client_secret.json`:** Prompt the user to provide their Google Cloud OAuth `client_secret.json`. They can either upload the file or paste its contents into the chat. Once they do, save it as `credentials.json` in the workspace. 2. **Explain the Flow:** Once you have the file, explain to the user exactly how the auth will work: > *"I have saved your credentials. I am now going to start the authentication process. I'll provide you with a Google login link. You'll need to click it, authorize your account, and then your browser will redirect to a blank `http://localhost...` page. Copy that full localhost URL and paste it back to me here!"* 3. **Run Authentication:** Run `gws auth login` in the background (using your `exec` tool). Extract the generated Google OAuth URL from the output and send it to the user. 4. **Complete Handshake:** When the user replies with the `http://localhost...` callback URL, use `curl` to fetch that exact URL. This completes the local webserver handshake for `gws`. Confirm successful authentication with the user.Technical Analysis
The mandatory authentication workflow directs the user to upload or paste an OAuth client-secret document into the conversation. This places sensitive authentication material in chat history, agent traces, telemetry, and any systems that retain conversation content.
The Skill then stores the material under the predictable name
credentials.jsonin the workspace. The mandatory workflow does not require restrictive file permissions, storage outside the project, cleanup after authentication, or exclusion from source control. Although another section recommendschmod 600for an alternative workflow, that safeguard is not incorporated into this workflow. ...[truncated 1717 chars]- Remediation
View remediation
Remediation Suggestions
- Never request OAuth client secrets, tokens, authorization codes, or complete callback URLs through chat.
- Prefer a direct browser-based OAuth flow using PKCE or a device authorization flow supported by the provider.
- Deliver the callback directly to the local OAuth listener without routing it through the agent.
- Store credentials outside the project workspace in an OS keyring or dedicated secret manager.
- If a temporary file is unavoidable, create it atomically with mode
0600, use a non-predictable path in a protected directory, and securely remove it immediately after use. - Prohibit credential contents from appearing in command output, debug logs, telemetry, or conversation history.
- Add credential filenames to
.gitignore, but do not treat.gitignoreas a substitute for secure storage. - Request only the minimum OAuth scopes needed for the current user operation.
