Back to skill

Security audit

日报和周报(daily-report and weekly-report)

Security checks for vulnerabilities and agentic risk

Overview

This skill coherently generates local work reports from git and TODO data, but users should review its local file outputs because they may contain sensitive project details.

Install only if you are comfortable with the agent reading git commit messages, TODO comments, and task files in the working tree and writing a local report. On shared machines, prefer changing the workflow to use a private mktemp directory and delete intermediate files after review.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:140
Finding

Predictable Shared Temporary Files Permit Local File Clobbering and Data Disclosure

Content
View full analysis
/tmp/commits.txt # Get detailed commit information grouped by author git log --since="$START_DATE" --until="$END_DATE" --pretty=format:"%ad | %s | %an" --date=short --no-merges > /tmp/commits_detailed.txt # Count commits COMMIT_COUNT=$(git log --since="$START_DATE" --until="$END_DATE" --oneline --no-merges | wc -l) ``` ```bash # Find all TODO comments echo "## TODO注释汇总" > /tmp/todos.txt grep -r -n "TODO\|FIXME\|HACK" . --include="*.js" --include="*.py" --include="*.java" --include="*.ts" --include="*.go" --include="*.cpp" --include="*.rs" 2>/dev/null | head -20 >> /tmp/todos.txt # Find todo files echo -e "\n## Todo文件内容" >> /tmp/todos.txt find . -name "TODO*" -o -name "todo*" -o -name "tasks*" 2>/dev/null | while read file; do echo "### $file" >> /tmp/todos.txt head -20 "$file" >> /tmp/todos.txt 2>/dev/null echo "" >> /tmp/todos.txt done ``` ```bash # Create report file REPORT_FILE="工作报告_$(date +%Y%m%d).md" # Populate report template cat > "$REPORT_FILE" << EOF # 工作报告 - $START_DATE 至 $END_DATE ## 概述 - **报告类型**: 周报 - **时间范围**: $START_DATE 至 $END_DATE - **生成时间**: $(date "+%Y-%m-%d %H:%M:%S") - **代码提交数量**: $COMMIT_COUNT ## 一、已完成的工作 ### 代码提交 $(cat /tmp/commits.txt | sed 's/^/- /') ### 功能完成 [根据提交信息总结完成的功能] ### 问题修复 [根据提交信息总结修复的问题] ## 二、进行中的任务 $(cat /tmp/todos.txt) ``` ### Technical Analysis The documented workflow stores project information in fixed, globally predictable paths: `/tmp/commits.txt`, `/tmp/commits_detailed.txt`, and `/tmp/todos.txt`. It does not securely create these files, verify their ownership or type, reject symbolic links, establish restrictive permissions, or isolate each execution in a private temporary directory. On systems ...[truncated 2514 chars]
Remediation
View remediation
&2 exit 1 } trap 'rm -rf -- "$TMP_DIR"' EXIT HUP INT TERM COMMITS_FILE="$TMP_DIR/commits.txt" COMMITS_DETAILED_FILE="$TMP_DIR/commits_detailed.txt" TODOS_FILE="$TMP_DIR/todos.txt" git log --since="$START_DATE" --until="$END_DATE" \ --oneline --no-merges > "$COMMITS_FILE" git log --since="$START_DATE" --until="$END_DATE" \ --pretty=format:"%ad | %s | %an" --date=short --no-merges \ > "$COMMITS_DETAILED_FILE" echo "## TODO comment summary" > "$TODOS_FILE" ``` Then reference the secured variables rather than fixed paths: ```bash sed 's/^/- /' "$COMMITS_FILE" cat "$TODOS_FILE" ``` Additional hardening measures: 1. Set `umask 077` before creating files so only the executing user can read or modify them. 2. Never reuse constant filenames directly under a shared temporary directory. 3. Use `mktemp` or `mktemp -d`; do not generate temporary names solely from timestamps or process IDs. 4. Register a cleanup trap immediately after creating the temporary directory. 5. Quote every pathname and use `--` where supported to prevent option confusion. 6. Avoid intermediate files entirely when feasible by retaining results in controlled variables or directly streaming data into the report. 7. If fixed files must be supported for compatibility, reject symbolic links, verify ownership and permissions, and open files using platform mechanisms that enforce exclusive creation and no-follow behavior. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill directs collection of git history, TODO comments, and task-file contents into temp files and a final report without an upfront warning that these sources may contain secrets, internal project names, incident details, credentials, or roadmap information. In a reporting context, aggregating and copying this data increases the chance of sensitive information being surfaced, retained on disk, or shared with unintended recipients.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The eval prompts are triggered by broad, ordinary workplace phrases like '生成周报' and '发日报', which can cause the skill to activate in many normal conversations without strong disambiguation. Because this skill summarizes potentially sensitive development artifacts such as git history and TODO notes, over-broad activation increases the chance of unintended invocation and unnecessary exposure of internal project information.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description says the skill generates reports by analyzing 'git提交记录、TODO注释和工作日志'. However, the concrete steps and commands only gather git logs, TODO comments, and TODO/task/notes files; there is no implementation for collecting or analyzing general work logs. This is a semantic mismatch between the claimed data sources and the actual documented behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill writes multiple intermediate files under /tmp and produces a final report file, but it does not clearly disclose artifact creation in advance or discuss retention/cleanup. In this context, repository history and TODO contents may be sensitive, and leaving them on disk can expose them to other local users, backups, or accidental sharing beyond the original reporting purpose.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The manifest frames this as a skill for generating structured daily/weekly work reports from repository artifacts. The pandoc-based HTML conversion introduces an extra document-conversion capability through an undeclared external tool, which is not necessary to fulfill the stated purpose of generating the report content itself. This is an ancillary capability not clearly justified by the manifest scope.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The manifest describes a skill triggered when users ask for daily or weekly reports, implying interactive on-demand use. The tip to set up cron for automatic scheduled generation extends the skill into task scheduling/automation, which is a distinct capability not described in the manifest. This is scope expansion beyond the stated purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

All user-facing prompt examples are written in Chinese, and the file does not indicate that language selection is optional or user-configurable. If these examples define expected interaction behavior, they may imply a fixed language preference without explicit opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

All user-facing comments and echo output are in Chinese, which imposes a specific language on users without any opt-in or stated regional justification. The policy calls for flagging language or locale constraints when the skill does not offer a choice or clearly document why a fixed locale is required.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This code creates a new directory, changes into it, initializes a git repository, and writes multiple files. Although the script prints progress messages, it does not explicitly disclose up front that it will modify the local filesystem, which is the kind of safety-relevant behavior covered by the missing-warning rule for code files.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.