T09 · Insecure Skill Coding Practices
- Location
scripts/triage-and-draft.sh:5- Finding
Hardcoded Default Keyring Password Protects Gmail Credentials
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Gmail assistant mostly matches its stated purpose, but it embeds a default keyring password and publishes/persists sensitive mailbox-derived content in ways users should review before installing.
Install only after replacing the hardcoded account and keyring password handling, deleting the packaged personal voice reference, adding clear consent for LLM processing of email summaries, using restrictive permissions and cleanup for Gmail caches, and requiring review before labels are applied.
scripts/triage-and-draft.sh:5Hardcoded Default Keyring Password Protects Gmail Credentials
scripts/apply-labels.sh:7JavaScript Code Injection Through GOG_ACCOUNT
SKILL.md:18Unredacted Email Metadata and Snippets Are Routed to an External LLM Workflow
scripts/triage-and-draft.sh:9Sensitive Gmail Content Is Persisted in Predictable Files Without Explicit Access Controls
This mismatch indicates undocumented local export/caching of inbox-derived data while the stated purpose emphasizes classification, labels, and draft replies. Hidden or under-described caching is particularly risky in a Gmail assistant because inbox summaries, labels, and related artifacts may contain sensitive personal, academic, financial, or account-security information that could be exposed or retained longer than intended.
This mismatch indicates undocumented local export/caching of inbox-derived data while the stated purpose emphasizes classification, labels, and draft replies. Hidden or under-described caching is particularly risky in a Gmail assistant because inbox summaries, labels, and related artifacts may contain sensitive personal, academic, financial, or account-security information that could be exposed or retained longer than intended.
Referenced artifact was not completely inspected
- `scripts/apply-labels.sh` reads classification results and applies Gmail labels via `gog`
Referenced artifact was not completely inspected
- `scripts/apply-labels.sh` reads classification results and applies Gmail labels via `gog`
Referenced artifact was not completely inspected
- `scripts/apply-labels.sh` reads classification results and applies Gmail labels via `gog`
Referenced artifact was not completely inspected
- `scripts/build-voice-reference.sh` (samples last 50 sent messages)
The KEYRING finding is a true issue because the script hardcodes a default keyring password and exports it into the environment, creating credential exposure and potential unauthorized access to stored Gmail-related secrets. In this skill context, the danger is elevated because the credential protects an email automation account, which could expose private communications and enable further mailbox manipulation.
set -euo pipefail
ACCOUNT="${GOG_ACCOUNT:-alan.alwakeel@gmail.com}"
export GOG_KEYRING_PASSWORD="${GOG_KEYRING_PASSWORD:-openclaw}"
LABELS_FILE="/home/delta/.openclaw/workspace/cache/gmail-triage-labels.json"
if [ ! -f "$LABELS_FILE" ]; then
The script hardcodes a default keyring password ('openclaw') into an environment variable, which effectively embeds credential material in code and enables unauthorized access wherever the same keyring configuration is used. Default secrets are especially dangerous because they are predictable, easily reused, and may grant access without any user interaction.
#!/usr/bin/env bash
set -euo pipefail
export GOG_KEYRING_PASSWORD="${GOG_KEYRING_PASSWORD:-openclaw}"
OUT_DIR="/home/delta/.openclaw/workspace/skills/gmail-secretary/references"
OUT="$OUT_DIR/voice.md"
This repeats the same insecure behavior by exporting a predictable default keyring password later in the script, reinforcing reliance on embedded credentials. Repetition increases the chance the script runs successfully with the unsafe default and normalizes insecure secret handling across environments.
mkdir -p "$OUT_DIR"
ACCOUNT="${GOG_ACCOUNT:-alan.alwakeel@gmail.com}"
export GOG_KEYRING_PASSWORD="${GOG_KEYRING_PASSWORD:-openclaw}"
TMP_IDS=$(mktemp)
trap 'rm -f "$TMP_IDS"' EXIT
The embedded Node code fetches full email bodies using 'gog gmail get --format=full' and stores excerpts in a persistent markdown file. Pulling complete message content magnifies exposure because redaction is incomplete and snippets can still contain confidential business context, names, schedules, or other sensitive content that becomes easier to exfiltrate from disk than from Gmail directly.
Exporting a default keyring password in the environment constitutes embedded credential material and can enable credential access by anyone who can read the script, process environment, or inherited subprocess state. In the context of a Gmail triage skill, this is especially dangerous because it can unlock mailbox access and facilitate broader account compromise.
set -euo pipefail
ACCOUNT="${GOG_ACCOUNT:-alan.alwakeel@gmail.com}"
export GOG_KEYRING_PASSWORD="${GOG_KEYRING_PASSWORD:-openclaw}"
VOICE_REF="/home/delta/.openclaw/workspace/skills/gmail-secretary/references/voice.md"
OUT_TRIAGE="/home/delta/.openclaw/workspace/cache/gmail-triage.md"
The skill declares operational behavior involving Gmail access, local file writes, and environment-backed tooling (gog, agent scripts), but does not declare any explicit tool scope or permissions boundary. That makes the effective access level ambiguous and increases the risk of over-privileged execution, especially for a skill that processes sensitive email content and writes artifacts to local cache paths.
The script exports a hardcoded default keyring password via GOG_KEYRING_PASSWORD, which embeds a credential-like secret directly in code and makes it available to child processes. Anyone with access to the script, environment, logs, or process context may recover or reuse this secret to access the gog keyring, so this is more than a missing warning issue in the context of a Gmail automation skill.
The script invokes the external gog CLI to create labels and modify Gmail threads, which changes user data in an external service. Although the file comments mention applying labels, there is no runtime disclosure, confirmation, or cautionary notice before performing these write operations.
The script enumerates recent sent Gmail messages, fetches full message contents, derives snippets, and persists them to a local reference file. Even though some redaction is attempted, this creates a secondary datastore of sensitive communication content that exceeds a narrow 'triage assistant' purpose and increases privacy and data-retention risk if the workstation, workspace, or repository is exposed.
This script accesses a real Gmail account and prepares to write derived data to disk without any user-facing warning, consent prompt, or disclosure in the script itself. In a skill context, silent access to mailbox data and silent local persistence undermines informed consent and can surprise users about how their communications are being processed.
The script hardcodes a real-looking Gmail account default and a default keyring password, which embeds credential-related material directly in the helper. Even if intended for convenience, defaulting authentication secrets in code makes unauthorized mailbox access far easier when the script is reused, leaked, or executed in an unintended environment.
The script retrieves inbox contents and stores the raw Gmail message search results in a predictable local cache file. Inbox metadata and message content are sensitive, and persisting them without clear user disclosure or protections increases the risk of unintended exposure through local compromise, backups, logs, or later processing by other tools.
The Node.js step derives subject, sender, snippets, and dates from inbox messages and writes them to another local JSON cache. Even summarized email data can contain confidential business or personal information, so creating an additional plaintext artifact broadens the exposure surface beyond the original mailbox.
Detected: suspicious.dangerous_exec