Back to skill

Security audit

agent-task-tracker

Security checks for vulnerabilities and agentic risk

Overview

This task-tracking skill is coherent, but it persistently records every task plus raw operational details in a shared memory file without redaction or clear user control.

Install only if you are comfortable with an automatic cross-session task log. Avoid using it for sensitive work unless you add rules to redact secrets, tokens, hostnames, raw commands, session IDs, and user-provided prompt text, and ensure memory/tasks.md is private to the right user and workspace.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T02 · Agent Memory Poisoning

Warning
Location
SKILL.md:8
Finding

Persistent Storage and Automatic Reloading of Untrusted Task Content

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 3, 8–21, and 41–50
Vulnerability Type: Persistent memory poisoning through unsanitized task-state storage
Risk Level: Medium

Vulnerable Code

markdown
description: Proactive task state management. Use on EVERY task start, progress update, completion, or failure. Tracks what was requested, what's running (background processes, SSH sessions), what's done, and what's next. Survives session resets. Triggers automatically — not user-invoked.
markdown
## State File

`memory/tasks.md` — single source of truth.

## When to Write

1. **Task received** → add entry with status `🔄 进行中`
2. **Background process started** → record session ID, PID, server, command
3. **Progress update** → update status/notes
4. **Task completed** → mark `✅ 完成`, record results/links
5. **Task failed** → mark `❌ 失败`, record error
6. **Session start** → read `memory/tasks.md` to resume awareness
markdown
- Update the file BEFORE reporting to user (write-first)
- Include enough detail to resume without prior conversation context
- For background processes: always record session ID + what server + what command
- For multi-step tasks: update after each step
- Keep it concise — this isn't a log, it's a state snapshot
- **Size limit: keep under 50 lines / 2KB** — this file is read every session start
- Completed tasks: collapse to one-line summary, reference daily notes for details
- Prune completed tasks older than 3 days
- If Active is empty, write (无) to make it obvious

Technical Analysis

The Skill directs the agent to copy task descriptions, progress notes, errors, results, links, commands, hostnames, process identifiers, and session identifiers into memory/tasks.md. It then treats that file as the “single source of truth” and reloads it at every session start.

Task descriptions and related fields can contain attacker-controlled ...[truncated 2604 chars]

Remediation
View remediation

Remediation Suggestions

  1. Store task state in a strict structured format with an allowlist of fields, bounded lengths, and validated value types.
  2. Treat every persisted value originating from users, commands, remote systems, errors, or tool output as untrusted data.
  3. Add an explicit instruction that text loaded from memory/tasks.md must never override system, developer, user, or Skill instructions and must never be executed as a command.
  4. Clearly delimit or encode stored values so task content cannot be confused with control instructions.
  5. Persist summaries rather than raw task text, command output, errors, links, or arbitrary notes.
  6. Require explicit user consent before enabling cross-session persistence, particularly in shared or multi-user environments.
  7. Redact secrets, access tokens, credentials, sensitive command arguments, internal hostnames, session identifiers, and PIDs before writing state.
  8. Record opaque references to background jobs instead of full shell commands and infrastructure details unless those values are essential.
  9. Apply restrictive file permissions and isolate memory files by user, workspace, and agent session.
  10. Define a short retention period and securely remove expired records rather than relying only on line-count limits.
  11. Validate restored records against the schema and ignore malformed, unexpectedly formatted, or instruction-like entries.
  12. Add tests proving that prompt-injection strings stored in task descriptions, notes, errors, and results remain inert when state is restored.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill is configured to trigger automatically on essentially every task lifecycle event, which makes persistent state capture the default behavior rather than an explicit, scoped action. In combination with writing to a shared memory file, this broad trigger greatly increases the chance of collecting and retaining sensitive user or operational data without necessity or consent.

Content

No source excerpt is available for this finding.

Context Leakage

High
Category
Data Exfiltration
Confidence
97% confidence
Finding

The instruction to record session ID, PID, server, and command is a direct context-leakage risk because it persists execution context that may reveal internal systems, active sessions, and sensitive command content. Such details can aid lateral movement, replay of operational steps, or exposure of secrets if the memory file is later read by other sessions, tools, or users.

Content

Scanner excerpt · SKILL.md (reported line 17)May include surrounding context.

md
## When to Write

1. **Task received** → add entry with status `🔄 进行中`
2. **Background process started** → record session ID, PID, server, command
3. **Progress update** → update status/notes
4. **Task completed** → mark `✅ 完成`, record results/links
5. **Task failed** → mark `❌ 失败`, record error

Context Leakage

High
Category
Data Exfiltration
Confidence
96% confidence
Finding

The rule to include enough detail to resume without prior context, combined with always recording server and command information, encourages over-collection of sensitive context into a file read on every session start. This materially increases exposure because the file becomes a persistent aggregation point for privileged operational knowledge and user/task data.

Content

Scanner excerpt · SKILL.md (reported line 44)May include surrounding context.

md
- Update the file BEFORE reporting to user (write-first)
- Include enough detail to resume without prior conversation context
- For background processes: always record session ID + what server + what command
- For multi-step tasks: update after each step
- Keep it concise — this isn't a log, it's a state snapshot
- **Size limit: keep under 50 lines / 2KB** — this file is read every session start

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill mandates writing task details to a persistent file as a 'single source of truth' but provides no user-facing disclosure, consent mechanism, or retention warning. This creates a privacy and data-governance risk because user requests, intermediate work state, and potentially sensitive outcomes may be stored across sessions unexpectedly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The status values are prescribed in Chinese (e.g. 进行中, 完成, 失败) without offering a language choice or documenting a justified locale constraint. This imposes a specific language on users and maintainers regardless of their locale.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Recording background session ID, PID, server name, and command line can expose sensitive infrastructure and operational context, including hostnames, internal topology, and command contents. If the command includes secrets, tokens, file paths, or customer identifiers, the tracker becomes a secondary repository of sensitive data that may be easier to access than the original environment.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.