Back to skill

Security audit

Rejection Logger

Security checks for vulnerabilities and agentic risk

Overview

This skill openly logs rejected options, but it is too broad and can persist sensitive prompts or internal decision details in plaintext without clear controls.

Review carefully before installing. Use this only in workspaces where persistent audit logs are acceptable, and avoid recording secrets, personal data, full prompts, hidden reasoning, or security-sensitive details. Treat `.learnings/REJECTIONS.md` as untrusted audit data, keep it out of version control unless intentionally shared, and prefer sanitized high-level summaries over raw request text.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • 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)

T02 · Agent Memory Poisoning

Warning
Location
scripts/log_rejection.sh:4
Finding
Persistent Agent Memory Poisoning Through Unescaped Markdown Log Entries<![CDATA[ ## Vulnerability Details **File Location**: `scripts/log_rejection.sh:4-19` **Vulnerability Type**: Persistent untrusted-content injection **Risk Level**: Medium ### Vulnerable Code ```bash TARGET=$1 REASON=$2 ALT=$3 TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ") ID="REJ-$(date +%Y%m%d)-$((RANDOM%900+100))" LEARNINGS_DIR=".learnings" FILE="$LEARNINGS_DIR/REJECTIONS.md" mkdir -p "$LEARNINGS_DIR" if [ ! -f "$FILE" ]; then echo "# Rejection Logs" > "$FILE" fi echo -e "\n## [$ID] $TARGET\n\n**Timestamp**: $TIMESTAMP\n**Decision**: REJECTED\n**Reason**: $REASON\n**Alternative**: $ALT" >> "$FILE" echo "✅ Logged rejection: $ID" ``` ### Technical Analysis The script accepts three caller-controlled arguments and directly appends them to `.learnings/REJECTIONS.md` without validation, encoding, or Markdown escaping. The use of `echo -e` is particularly unsafe because backslash escape sequences in the supplied values may be interpreted. An attacker can therefore inject line breaks, fabricated log entries, Markdown headings, or instruction-like content. The destination is explicitly presented as a learning and audit file. If this file is later loaded into an agent's context or treated as trusted long-term state, injected content may influence future sessions. The vulnerability does not directly execute shell commands because the variables are expanded inside a quoted argument, but it permits persistent content manipulation. ### Attack Path 1. An attacker controls or influences the target, reason, or alternative passed to `log_rejection.sh`. 2. The attacker includes escape sequences and crafted Markdown, such as a fabricated section containing instructions for a future agent. 3. `echo -e` interprets supported escape sequences and appends the resulting content to `.learnings/REJECTIONS.md`. 4. The forged content persists after the script finishes. 5. A later agent or automation process reads the learning file as trusted context. 6. The injected content can ...[truncated 613 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Replace `echo -e` with `printf` using a fixed format string so user input is never interpreted as formatting or escape sequences. - Validate each field and reject control characters and unexpected newlines where multiline input is unnecessary. - Escape Markdown metacharacters before writing values to a Markdown document. - Prefer a structured format such as JSON Lines, with each field serialized by a trusted JSON encoder. - Mark all stored entries as untrusted data and never load them as agent instructions. - Separate agent-readable instructions from audit data and enforce a strict parser when records are consumed. - Restrict file permissions, for example by setting a restrictive `umask`, to reduce unauthorized modification or disclosure. - Add tests covering embedded newlines, backslash escapes, Markdown headings, links, and instruction-like payloads. A safer shell implementation should use fixed formatting, for example: ```bash printf '\n## [%s] %s\n\n**Timestamp**: %s\n**Decision**: REJECTED\n**Reason**: %s\n**Alternative**: %s\n' \ "$ID" "$SANITIZED_TARGET" "$TIMESTAMP" "$SANITIZED_REASON" "$SANITIZED_ALT" >> "$FILE" ``` The `SANITIZED_*` values must be validated or encoded before this operation. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:3
Finding
Unrestricted Persistent Logging of Potentially Sensitive Prompts and Decision Data<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:3-35` **Vulnerability Type**: Excessive collection and plaintext retention of potentially sensitive information **Risk Level**: Medium ### Vulnerable Instructions ```markdown description: Captures and logs choices, options, or prompts that the agent evaluated and decided NOT to execute. Use whenever you skip a task, reject an approach, or choose one method over another to provide transparency into your reasoning. --- # Rejection Logger Transparency isn't just about showing what you did; it's about explaining what you *didn't* do. This skill helps you document rejected paths. ## Core Workflow ### 1. Identify Rejection When you evaluate multiple ways to solve a problem and pick one, or when you decide a user request is unsafe/out of scope, log it. ### 2. Log Entry Append to `.learnings/REJECTIONS.md` (create if missing): ```markdown ## [REJ-YYYYMMDD-XXX] <short_title> **Timestamp**: ISO-8601 **Target**: <What was requested or considered> **Decision**: REJECTED **Reason**: <Why it was rejected (e.g., safety, complexity, better alternative)> **Alternative**: <What was done instead> ``` ## When to Use - When a user asks for something and you say "No" or "I can't". - When you consider two tools and pick one. - When you refactor code and decide against a specific library. ## Benefits - **Audit Trail**: Humans can see your internal deliberation. - **Trust**: Showing rejections proves you are thinking, not just guessing. - **Self-Correction**: Reviewing rejections helps you refine your decision boundaries. ``` ### Technical Analysis The skill directs the agent to persist prompts, considered options, rejection reasons, and alternatives whenever a request or approach is rejected. It provides no data-minimization rules, secret detection, redaction requirements, consent mechanism, retention period, access-control guidance, or exclusion for personal and confidential information. Rejected requests ...[truncated 1519 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Adopt data minimization: record a non-sensitive event identifier and a short standardized reason code rather than the original prompt. - Explicitly prohibit logging passwords, tokens, private keys, authentication headers, personal information, proprietary source code, and complete prompt bodies. - Apply automated secret and sensitive-data redaction before creating an entry. - Do not request or retain hidden internal reasoning. Store only a concise, user-appropriate decision summary. - Require user or administrator opt-in before enabling persistent logging. - Define a retention period and provide an automatic deletion or rotation mechanism. - Store logs outside version-controlled paths and add `.learnings/REJECTIONS.md` to `.gitignore` where appropriate. - Create files with restrictive permissions and document which users and processes may access them. - Provide a safe schema containing fields such as timestamp, opaque request ID, rejection category, and sanitized summary. - Document that log files are untrusted audit data and must not be interpreted as instructions by future agents. ]]>
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Vague Triggers

Medium
Confidence
94% confidence
Finding
The description is broad enough that the skill may be invoked in many normal reasoning situations, including routine tool selection or refusals. That can cause unnecessary activation and logging of internal deliberation or rejected options, which increases the risk of oversharing sensitive reasoning, user content, or security-related decision paths.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The usage guidance says to use the skill whenever the agent says no, chooses between tools, or rejects a library, but it does not define boundaries for what should never be recorded. In this context, that encourages systematic logging of internal decision-making into a file, which can expose sensitive prompts, rejected attack paths, or policy-enforcement details to later readers or processes.

Static analysis

No suspicious patterns detected.