Back to skill

Security audit

carpe-diem

Security checks for vulnerabilities and agentic risk

Overview

The skill’s main behavior matches a project-planning assistant, but its installer has a real local file-safety issue and outdated install docs that deserve review before installation.

Review the installer before running it. Prefer the manual plan/apply/verify flow, inspect the generated plan, and avoid running the one-click installer on multi-user systems until the temporary-file handling and stale download-and-execute documentation are fixed. Grant project-directory, GitHub, issue, CI, and profile access only for the specific scope you intend to use.

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
install.sh:201
Finding

Predictable Temporary Plan File Allows Symlink-Based File Clobbering

Content
View full analysis

Vulnerability Details

File Location: install.sh, lines 201-208
Vulnerability Type: Predictable temporary file and unsafe shell redirection
Risk Level: Medium

Vulnerable Code

bash
PLAN_FILE="/tmp/carpe-diem-install-$$.json"
PLAN_ARGS=("--platform" "$PLATFORM" "--json")

if [ -n "$TARGET" ]; then
  PLAN_ARGS+=("--target" "$TARGET")
fi

"$PYTHON" scripts/carpe_diem.py install plan "${PLAN_ARGS[@]}" > "$PLAN_FILE" 2>/dev/null

Technical Analysis

The installer creates its plan at a predictable path derived from the process ID. It then opens that path using ordinary shell output redirection without secure exclusive creation or a private temporary directory.

On systems where other local users can write to /tmp, an attacker can predict or race the installer process ID and create the expected path as a symbolic link. Shell redirection follows symbolic links, so the installer may truncate and overwrite an attacker-selected file that is writable by the victim running the installer.

The plan file is also left in /tmp after a normal installation. Its permissions depend on the invoking user's umask, and it contains local source and target paths. Under permissive settings, this may disclose filesystem layout information to other local users.

Attack Path

  1. A local attacker monitors or estimates process IDs assigned to processes run by the victim.
  2. The attacker creates a symbolic link such as /tmp/carpe-diem-install-<predicted-pid>.json pointing to a file writable by the victim.
  3. The victim launches install.sh with the predicted process ID.
  4. The shell evaluates the output redirection and follows the attacker-created symbolic link.
  5. The linked file is truncated and replaced with the generated installation-plan JSON.
  6. If the attacker wins the race, this can corrupt user configuration or other files available under the victim's existing permissions.

Impact Ass

...[truncated 554 chars]

Remediation
View remediation

Remediation Suggestions

Replace the predictable path with a securely created temporary file, restrict its permissions, and guarantee cleanup:

bash
PLAN_FILE="$(mktemp "${TMPDIR:-/tmp}/carpe-diem-install.XXXXXX.json")"
chmod 600 "$PLAN_FILE"
trap 'rm -f -- "$PLAN_FILE"' EXIT

PLAN_ARGS=("--platform" "$PLATFORM" "--json")

if [ -n "$TARGET" ]; then
  PLAN_ARGS+=("--target" "$TARGET")
fi

"$PYTHON" scripts/carpe_diem.py install plan "${PLAN_ARGS[@]}" > "$PLAN_FILE" 2>/dev/null

Additional hardening measures:

  • Prefer a private directory created with mktemp -d if more temporary artifacts are added.
  • Ensure the temporary file is created atomically rather than checking for existence before creation.
  • Use a cleanup trap covering successful execution, failures, and signals.
  • Do not intentionally retain the plan after dry runs unless the user explicitly requests an output path.
  • If retaining a plan is necessary, place it in a user-controlled directory with mode 0600 and clearly report its location.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (83)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared purpose describes an ideation/planning/tracking assistant behavior for end users. The actual code chunk does not implement that project-direction functionality; instead, it performs operational setup: environment checks, platform detection, install plan generation, installation, and verification. This is a materially different primary purpose from the declared description. While installation may support distributing the skill, this code chunk itself is not helping users discover or plan projects, and it exercises undeclared local file/system installation capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a user-facing ideation/planning skill for choosing and tracking open-source projects. The supplied code does not help discover project directions, validate ideas, create implementation plans, or track project progress for users. Instead, it is an internal repository QA/validation script for a wisdom-card knowledge base. Its primary purpose is materially different: validating file structure, metadata consistency, routing cases, and documentation text across repository resources. This is not a supporting implementation detail of the declared skill's behavior; it is a separate maintenance/testing capability that is undeclared.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. 若 `scripts/carpe_diem.py` 可用,先读取个人画像和当前项目状态;准备提出或写入状态时再阅读 `references/state-schema.md`。脚本不可用时明确说明本次不会自动续接或保存。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
先把当前 `SKILL.md` 所在目录解析为 Skill 根目录,再直接调用已定义的子命令。不要为了发现接口而通读脚本源码,也不要先试探不存在的子命令。

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill explicitly instructs use of shell commands, file reads, and file writes, but does not declare any explicit tool scope or permissions boundary. That creates an authorization ambiguity where a host agent may grant broader capabilities than users expect, increasing the risk of unintended filesystem access or state modification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The install instructions state that the script may download from GitHub and execute when not run from the project root, but they do not prominently warn users about the trust boundary, pinning, or integrity verification requirements. This creates a software supply-chain risk: users may execute remotely retrieved code without understanding what is being fetched, from which revision, or how authenticity is verified.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L38 将触发方式写为“帮我找到一个值得做的开源项目”,这是自然日常请求,不具备足够强的技能专属性,也未提供边界或反例来说明何时应触发或不应触发。对于 markdown 文件,这属于过于宽泛的触发描述,可能与用户普通咨询场景发生碰撞。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The installation instructions explicitly state that if the script is not run from the project root, it will download code from GitHub and then execute it. That creates a real supply-chain and arbitrary code execution risk because users are encouraged to run a shell script without an explicit warning about network access, trust boundaries, pinning, or manual review.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · adapters/claude-code/INSTALL.md (reported line 38)May include surrounding context.

python3 scripts/carpe_diem.py install verify --target ~/.codex/skills/carpe-diem

text

重启或新开 Codex 会话后,用“我想做一个项目,但没有头绪”触发。若当前 Codex 版本未自动发现用户 Skill,可直接要求它读取 `~/.codex/skills/carpe-diem/SKILL.md`。

目录和重启说明依据 OpenAI 的 [Agent Skills 仓库](https://github.com/openai/skills)。本机首次验证版本会记录在 `docs/internal-testing.md`。

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · adapters/codex/INSTALL.md (reported line 38)May include surrounding context.

python3 scripts/carpe_diem.py install verify --target ~/.codex/skills/carpe-diem

text

重启或新开 Codex 会话后,用“我想做一个项目,但没有头绪”触发。若当前 Codex 版本未自动发现用户 Skill,可直接要求它读取 `~/.codex/skills/carpe-diem/SKILL.md`。

目录和重启说明依据 OpenAI 的 [Agent Skills 仓库](https://github.com/openai/skills)。本机首次验证版本会记录在 `docs/internal-testing.md`。

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

Line L38 instructs users to trigger the skill with a specific Chinese phrase, which implies a fixed language requirement. The file does not offer alternative trigger languages or state that Chinese is optional, creating a language/locale policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The install guide states that if the script is not run from the project root, it will download code from GitHub and then execute it. That behavior exceeds the skill's stated read-only/project-planning purpose and introduces a software supply-chain risk because users are encouraged to run a helper that may fetch and execute remote code without strong trust boundaries or verification being documented here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instructions mention the script will automatically download and execute code from GitHub, but they do not present this as a prominent security warning before users are told to run the installer. For an end-user skill whose purpose is ideation and planning rather than code execution, this omission increases the chance that users will run unreviewed remote code with normal user privileges.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation explicitly states that the installer may download code from GitHub and execute it when not run from the project root. That creates a supply-chain and remote-code-execution risk that is not necessary for a skill whose stated purpose is project discovery, planning, and read-only tracking, making the install path broader and more dangerous than the skill's function requires.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Telling users that a script may fetch from GitHub and execute code without a prominent warning normalizes unsafe execution of remotely retrieved code. Users may run the command without understanding that they are granting code execution to whatever content is fetched at install time, increasing supply-chain compromise risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The uninstall example uses --yes, which suppresses confirmation for a destructive action, but the documentation does not warn that it will remove the installed skill immediately. This can lead to accidental deletion of the installed target, especially if users adapt the command to a different path without fully understanding the flag.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The entire guide is written as a prescriptive skill document in Chinese, and it includes an integration requirement for bilingual routing consistency rather than offering the user a language choice. Under the policy rule, forcing a specific language without explicit opt-in is a natural-language policy concern unless the locale restriction is clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file is written as a prescriptive planning document entirely in Chinese, beginning with a Chinese-titled artifact and continuing throughout without any indication that language selection is optional. Under the policy rule, forcing a specific language or locale without user opt-in is a natural-language policy violation unless the regional constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire document is written as Chinese-only operational documentation, including headings, status notes, and workflow descriptions, with no indication that users may choose another language or that the Chinese-only constraint is intentional for a specific region. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · install.sh (reported line 21)May include surrounding context.

sh
#   --platform <name>   Target platform: codex, claude-code, cursor, openclaw (默认 auto-detect)
#   --target <path>     Install directory (platform default if omitted)
#   --dry-run           Generate and show install plan without applying
#   --skip-verify       Skip verification step after apply
#   --help, -h          Show this help message

set -euo pipefail

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · install.sh (reported line 65)May include surrounding context.

sh
#   --platform <name>   Target platform: codex, claude-code, cursor, openclaw (默认 auto-detect)
#   --target <path>     Install directory (platform default if omitted)
#   --dry-run           Generate and show install plan without applying
#   --skip-verify       Skip verification step after apply
#   --help, -h          Show this help message

set -euo pipefail

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · install.sh (reported line 75)May include surrounding context.

sh
PLATFORM=""
TARGET=""
DRY_RUN=false
SKIP_VERIFY=false

while [[ $# -gt 0 ]]; do
  case "$1" in

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill claims read-only progress tracking but asks for filesystem write access, which is inconsistent with user expectations and the declared use case. This can enable unauthorized modification of repository files, notes, or configuration under the guise of a planning/tracking assistant.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest describes a skill for project direction, idea validation, planning, and read-only tracking, yet it requests shell execution. That capability materially exceeds what is needed for the stated purpose and would let the skill run arbitrary local commands if invoked, expanding the blast radius from advisory behavior to code execution.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Shell execution is unjustified by the stated functionality of a project-direction and planning skill, making the permission set disproportionate to the business purpose. In this context, the capability is more dangerous because users would reasonably expect advisory, low-risk behavior, not command execution that could alter the system, access secrets, or chain with network search for broader abuse.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.insecure_tls_verification

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
install.sh:75