Back to skill

Security audit

Feedback Loop

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent local feedback analytics skill, with practical privacy and file-export cautions but no hidden execution, credential access, exfiltration, or persistence backdoor.

Install only if you are comfortable storing feedback comments, session identifiers, behavioral metrics, and generated suggestions locally in the skill's data files. Avoid passing sensitive conversation or customer data in metrics/context, set your own cleanup/retention process, and use export paths carefully because an existing writable file can be overwritten.

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
bin/cli.js:429
Finding

Unrestricted File Overwrite Through Export Path

Content
View full analysis

Vulnerability Details

File Location: bin/cli.js:429-434
Vulnerability Type: Arbitrary file overwrite
Risk Level: Medium

Vulnerable Code

js
function handleExport(fl, options) {
  const format = options.format || 'json';
  const data = fl.exportData(format);
  
  if (options.output) {
    fs.writeFileSync(options.output, data);
    console.log(`Data exported to ${options.output}`);
  } else {
    console.log(data);
  }
}

Technical Analysis

The CLI passes the user-controlled --output argument directly to fs.writeFileSync. The destination is not canonicalized or restricted to an approved export directory, and the implementation does not check whether the destination already exists or is a symbolic link.

fs.writeFileSync truncates an existing destination by default. Consequently, any process or user able to invoke the CLI can replace arbitrary files writable by that process. This is particularly relevant when an AI Agent constructs the command from untrusted instructions or runs the Skill under an account with access to important workspace or user configuration files.

The vulnerability does not independently escalate operating-system privileges. Its reach is limited to paths writable by the invoking account.

Attack Path

  1. An attacker causes a user or Agent to invoke the export command with a crafted destination:
    bash
    feedback-loop export --format json --output /path/to/writable/important-file
    
  2. parseArgs stores the attacker-selected path in options.output.
  3. handleExport generates the export content.
  4. fs.writeFileSync(options.output, data) opens the selected file for writing and truncates it.
  5. The original file is replaced with exported JSON or CSV content, potentially corrupting configuration, application data, workspace content, or user startup files.

A symbolic link located at an apparently safe destination could also redirect the write to another writable target.

Impact Assess

...[truncated 641 chars]

Remediation
View remediation

Remediation Suggestions

  1. Resolve the requested path with path.resolve and require it to remain inside a dedicated export directory.
  2. Reject absolute paths and traversal components unless arbitrary destinations are an explicit, trusted administrative feature.
  3. Use fs.lstatSync to reject symbolic links and validate each relevant parent directory where the threat model includes untrusted local filesystem content.
  4. Prevent replacement by default using exclusive creation:
    js
    fs.writeFileSync(validatedPath, data, {
      encoding: 'utf8',
      flag: 'wx'
    });
    
  5. Require an explicit --force option and confirmation before overwriting an existing regular file.
  6. Document that export destinations must be trusted and run the Skill with least-privilege filesystem permissions.
  7. Add tests covering absolute paths, ../ traversal, existing files, symbolic links, and destinations outside the approved export directory.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
82% confidence
Finding

The description is broader than the supplied code. The implementation clearly supports collecting explicit and implicit feedback and performing basic analysis via sentiment inference and session-pattern detection. However, there is no code that takes action based on the feedback, triggers improvements, or closes a feedback loop beyond storage and retrieval. This is a meaningful description-to-behavior mismatch because a key declared capability ('act on user feedback for continuous agent improvement') is absent from the provided chunk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly describes automatic detection, collection, and storage of implicit session feedback signals, which can capture behavioral and contextual data without a clear consent flow or prominent privacy warning. In an agent environment, this can lead to unanticipated retention of potentially sensitive usage patterns, session identifiers, comments, and metadata, increasing privacy and compliance risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes a skill for collecting, analyzing, and acting on user feedback for agent improvement. This CLI also exposes a distinct data export capability, including writing JSON/CSV files, which is not mentioned as part of the skill's stated purpose and goes beyond the described feedback-loop operations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The implementation supports exporting accumulated data and writing it to a user-specified file path. File export is not an obviously required detail of 'collect, analyze, and act on user feedback' and represents additional behavior not reflected in the manifest description.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This JSON file contains natural-language period values such as "3月6日周五" through "3月12日周四", which hard-code a Chinese locale in user-facing text. Under the policy, forcing a specific language or locale without opt-in or documented regional justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code records implicit feedback derived from user interaction data and stores associated metrics/context without any evidence of notice, consent, or minimization at the collection point. In a feedback-analysis skill, this can capture behavioral telemetry users may not expect, creating privacy and compliance risk if sensitive session details are included in metrics or context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

autoDetect analyzes full sessionData, infers behavioral issues such as frustration or abandonment, and persists those inferences by passing the entire sessionData into stored metrics. This increases privacy risk because it creates derived profiling data and may store more session information than necessary, all without any visible warning, consent, or data minimization in this component.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The primary skill description and section content are presented in Chinese, with no indication that other languages are supported or that language is user-selectable. Under the policy, forcing a specific language without opt-in can be a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code hard-codes the 'zh-CN' locale when generating week bucket labels. This imposes a specific language/locale choice on all users without offering configuration or documenting a region-specific requirement.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This code persists generated suggestions via saveSuggestion, which is a file/data write operation covered by the warning requirement for code files. While the file has internal comments, it does not include any user-facing prompt, log, or explicit disclosure that suggestion data will be saved.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.