T09 · Insecure Skill Coding Practices
- Location
scripts/inject_and_run.sh:13- Finding
Reusable OAuth Credential Injected into Remote Colab Code
- Content
View full analysis
"$TMPSCRIPT" # Run on Colab SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" python3 "$SCRIPT_DIR/colab_run.py" exec --file "$TMPSCRIPT" "$@" ``` The documented remote-side usage decodes and writes the credential: ```python TOKEN_B64 = "__COLAB_TOKEN_PLACEHOLDER__" token_data = json.loads(base64.b64decode(TOKEN_B64)) with open('/tmp/token.json', 'w') as f: json.dump(token_data, f) creds = Credentials.from_authorized_user_file('/tmp/token.json') service = build('drive', 'v3', credentials=creds) ``` ### Technical Analysis The script reads the complete local `~/.colab-mcp-auth-token.json` file, Base64-encodes it, substitutes it into Python source code, and submits that source to a remote Google Colab runtime. Base64 is a transport encoding and provides no confidentiality. The credential file may include both access and refresh tokens. Consequently, the remote runtime receives a reusable account credential rather than a narrowly delegated, short-lived capability. The credential may also cover identity, Colab, and Drive scopes. This exceeds the minimum privilege needed when a remote task only needs to read or write a specific checkpoint. The local temporary script is assigned mode `0600` and remo ...[truncated 1636 chars]- Remediation
View remediation
