Back to skill

Security audit

gtasks-cli

Security checks for vulnerabilities and agentic risk

Overview

This Google Tasks skill is mostly purpose-aligned, but it includes unsafe command guidance that could expose credentials or run unintended shell commands.

Install only if you trust the gtasks CLI and are comfortable granting it Google Tasks access. Avoid commands that print GTASKS_CLIENT_SECRET, review any delete operations carefully, and do not copy the advanced bash -c parallel-export example; use safer scripts that pass task-list names as data.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
references/ADVANCED.md:139
Finding
Command Injection Through Untrusted Task-List Names<![CDATA[ ## Vulnerability Details **File Location**: `references/ADVANCED.md:139` **Vulnerability Type**: Shell command injection through unsafe interpolation into `bash -c` **Risk Level**: High ### Vulnerable Code ```bash gtasks tasklists view | grep -oP '\[\d+\] \K.*' | xargs -P 4 -I {} bash -c 'gtasks tasks view -l "{}" --format=json > "$(echo {} | tr " " "_").json"' ``` ### Technical Analysis The command parses task-list names and substitutes each name directly into a shell program passed to `bash -c`. Quoting the placeholder as `"{}"` does not make this safe because `xargs` performs textual substitution before the resulting command string is interpreted by Bash. If a task-list name contains shell syntax such as command substitution, backticks, quotation marks, or other metacharacters, that syntax can alter the generated shell program. For example, a list name containing `$(malicious-command)` can cause Bash to execute that command while evaluating the interpolated argument or output filename. Task-list names originate from Google Tasks data and must be treated as untrusted data rather than executable shell source. ### Attack Path 1. An attacker gains a means to influence a task-list title consumed by the user, or convinces the user to create/import a specially crafted title. 2. The title includes shell syntax such as `$(malicious-command)`. 3. The user or Agent runs the documented parallel-export command. 4. `xargs` substitutes the crafted title into the text passed to `bash -c`. 5. Bash parses the inserted syntax and executes the attacker-controlled command with the privileges of the user running the Skill. ### Impact Assessment Successful exploitation permits arbitrary command execution under the current local user account. The attacker could potentially: - Read files accessible to the user, including `~/.gtasks/token.json` and other credentials. - Modify or delete user-owned files. - Access Google Tasks through the authenticated CLI session. ...[truncated 250 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Do not insert task-list names into shell source passed to `bash -c`. Process each title strictly as data and quote every variable expansion: ```bash gtasks tasklists view | grep -oP '\[\d+\] \K.*' | while IFS= read -r list; do safe_name=$(printf '%s' "$list" | sed 's/[^A-Za-z0-9._-]/_/g') gtasks tasks view -l "$list" --format=json > "${safe_name}.json" done ``` Additional hardening should include: 1. Prefer structured output from `gtasks tasklists view`, if supported, instead of parsing human-readable output. 2. Reject empty names and reserved path components such as `.` and `..`. 3. Ensure the sanitized filename cannot contain `/`, path traversal sequences, control characters, or leading option characters. 4. Detect filename collisions after sanitization rather than silently overwriting an existing export. 5. If parallel processing is required, pass values as positional arguments or through a structured scripting language; never splice them into executable shell text. 6. Store exports in a dedicated directory created with restrictive permissions. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
references/QUICK-REFERENCE.md:19
Finding
OAuth Client Secret Disclosed Through Terminal Output<![CDATA[ ## Vulnerability Details **File Location**: `references/QUICK-REFERENCE.md:19-23` **Vulnerability Type**: Plaintext credential exposure **Risk Level**: Medium ### Vulnerable Code ```bash # Check environment variables (macOS/Linux) echo $GTASKS_CLIENT_ID echo $GTASKS_CLIENT_SECRET # Check environment variables (Windows PowerShell) echo $env:GTASKS_CLIENT_ID echo $env:GTASKS_CLIENT_SECRET ``` ### Technical Analysis The documented system check prints the complete value of `GTASKS_CLIENT_SECRET` to standard output. This is unnecessary when the intended purpose is only to confirm whether the environment variable is configured. Terminal output can be retained by Agent transcripts, CI logs, terminal recording software, remote support sessions, screen sharing, or monitoring systems. Printing the credential therefore expands its exposure beyond the process environment. This guidance also conflicts with the safer presence-only checks in `SKILL.md:421`. Although an OAuth desktop client secret may not independently provide access to the user's Google account, it remains an application credential and should not be disclosed. ### Attack Path 1. A user configures `GTASKS_CLIENT_SECRET` with a real OAuth client secret. 2. The user or Agent follows the quick-reference instruction to run the system checks. 3. The full secret is printed to terminal output. 4. The output is captured by an Agent conversation, CI log, terminal recorder, shared screen, or another logging mechanism. 5. A party with access to that retained output obtains the OAuth application credential and may use it in attempts to impersonate or abuse the associated OAuth client. ### Impact Assessment The direct impact is disclosure of the OAuth client secret. Depending on the Google Cloud configuration and surrounding authentication controls, this may enable: - Impersonation or unauthorized use of the registered OAuth client. - Abuse of the associated OAuth application configuration or quota. - ...[truncated 368 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Replace value-printing commands with presence-only checks. For macOS and Linux: ```bash [ -n "${GTASKS_CLIENT_ID:-}" ] && echo "GTASKS_CLIENT_ID is set" || echo "GTASKS_CLIENT_ID is not set" [ -n "${GTASKS_CLIENT_SECRET:-}" ] && echo "GTASKS_CLIENT_SECRET is set" || echo "GTASKS_CLIENT_SECRET is not set" ``` For PowerShell: ```powershell if ($env:GTASKS_CLIENT_ID) { "GTASKS_CLIENT_ID is set" } else { "GTASKS_CLIENT_ID is not set" } if ($env:GTASKS_CLIENT_SECRET) { "GTASKS_CLIENT_SECRET is set" } else { "GTASKS_CLIENT_SECRET is not set" } ``` Also: 1. Warn users never to paste or print the secret in Agent conversations, logs, screenshots, or support channels. 2. Use a secrets manager where available. 3. Restrict permissions on credential files to the owning user. 4. Rotate the OAuth client secret if it has already appeared in retained or shared output. 5. Keep the quick-reference guidance consistent with the presence-only checks already used in `SKILL.md`. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Session Persistence

Medium
Category
Rogue Agent
Content
---
name: gtasks-cli
description: Manage Google Tasks from the command line - view, create, update, delete tasks and task lists. Use when the user asks to interact with Google Tasks, manage to-do items, create task lists, mark tasks complete, or check their Google Tasks.
homepage: https://github.com/BRO3886/gtasks
license: MIT
compatibility: Requires gtasks CLI tool to be installed and authenticated
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The skill description uses very broad activation phrases like managing to-do items or checking tasks, which can cause the skill to trigger on common productivity requests beyond an explicitly scoped Google Tasks intent. In an agent ecosystem, this increases the chance of overbroad invocation and unintended access to a user's authenticated task data or unintended task mutations.

Session Persistence

Medium
Category
Rogue Agent
Content
**How to get credentials:**
1. Go to [Google Cloud Console](https://console.cloud.google.com/)
2. Create a new project or select an existing one
3. Enable the Google Tasks API
4. Create OAuth2 credentials (Application type: "Desktop app")
5. Note the authorized redirect URIs that gtasks uses:
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
# Recommended: store in a file with restricted permissions
echo 'export GTASKS_CLIENT_ID="your-client-id"' >> ~/.gtasks_env
echo 'export GTASKS_CLIENT_SECRET="your-client-secret"' >> ~/.gtasks_env
chmod 600 ~/.gtasks_env
# Source it from your shell profile
echo 'source ~/.gtasks_env' >> ~/.zshrc
```
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
# Recommended: store in a file with restricted permissions
echo 'export GTASKS_CLIENT_ID="your-client-id"' >> ~/.gtasks_env
echo 'export GTASKS_CLIENT_SECRET="your-client-secret"' >> ~/.gtasks_env
chmod 600 ~/.gtasks_env
# Source it from your shell profile
echo 'source ~/.gtasks_env' >> ~/.zshrc
```
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

File System Enumeration

Medium
Category
Data Exfiltration
Content
gtasks login
```

This will open a browser for OAuth2 authentication. The token is stored in `~/.gtasks/token.json` with 0600 permissions. Verify with `ls -la ~/.gtasks/token.json`. If you no longer need access, run `gtasks logout` to revoke and delete the token.

## Core Concepts
Confidence
60% confidence
Finding
Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

File System Enumeration

Medium
Category
Data Exfiltration
Content
gtasks login
```

This will open a browser for OAuth2 authentication. The token is stored in `~/.gtasks/token.json` with 0600 permissions. Verify with `ls -la ~/.gtasks/token.json`. If you no longer need access, run `gtasks logout` to revoke and delete the token.

## Core Concepts
Confidence
60% confidence
Finding
Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Session Persistence

Medium
Category
Rogue Agent
Content
## Common Workflows

### Quick Task Creation
When a user says "add a task to my work list":
```bash
gtasks tasks add -l "Work" -t "Task title"
```
Confidence
80% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Session Persistence

Medium
Category
Rogue Agent
Content
# Proceed with operations
gtasks tasks add -l "Work" -t "New Task" || {
  echo "Error: Failed to create task" >&2
  exit 1
}
```
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The testing example includes a cleanup command that removes a task list using `gtasks tasklists rm <<< "1"` without an explicit warning that it is destructive and depends on positional list numbering. In documentation for a CLI that manages real user data, readers may copy this pattern into live environments and accidentally delete the wrong list if list order changes or if they are not operating on an isolated test account.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The quick reference explicitly instructs users to print `GTASKS_CLIENT_ID` and `GTASKS_CLIENT_SECRET` to the terminal. While this is framed as troubleshooting, it can expose secrets on-screen, into terminal scrollback, screen recordings, shared sessions, or shell logging systems, increasing the chance of credential disclosure.

Static analysis

No suspicious patterns detected.