Back to skill

Security audit

Correction Logger

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed local correction-history logger, but users should treat its stored correction records as sensitive persistent memory.

Install only if you are comfortable keeping correction history on disk. Avoid logging secrets, credentials, private customer data, or sensitive prompts unless you add redaction, access controls, retention limits, deletion tooling, and approval rules for which correction records may influence future agent behavior.

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
scripts/correction_logger.py:190
Finding

Persistent Agent Memory Poisoning Through Untrusted Correction Records

Content
View full analysis
str: # Generate the correction ID timestamp = datetime.now().isoformat() unique_str = f"{timestamp}{user_input}{agent_response}{corrected_response}" correction_id = f"corr_enh_{hashlib.md5(unique_str.encode()).hexdigest()[:12]}" # Prepare context and tags context_json = json.dumps(context, ensure_ascii=False) if context else "{}" tags_json = json.dumps(tags, ensure_ascii=False) if tags else "[]" # Prepare the backward-compatible Markdown representation display_time = datetime.now().strftime("%Y‑%m‑%d %H:%M:%S") context_str = "" if context: try: context_str = f" [上下文: {json.dumps(context, ensure_ascii=False)[:100]}...]" except (TypeError, ValueError): context_str = f" [上下文: {str(context)[:100]}...]" markdown_line = ( f"- **{display_time}** 用户纠正: {user_input} | " f"代理回应: {agent_response} | " f"纠正后: {corrected_response}{context_str}\n" ) try: with self._get_connection() as conn: cursor = conn.cursor() cursor.execute(''' INSERT INTO corrections ( id, timestamp, user_input, agent_response, corrected_ ...[truncated 5321 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (18)

Unvalidated Output Injection

High
Category
Output Handling
Confidence
95% confidence
Finding

Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.

Content

Scanner excerpt · scripts/correction_logger.py (reported line 446)May include surrounding context.

python
return []
                    
                    where_clause = " OR ".join(query_terms)
                    cursor.execute(f'''
                        SELECT 
                            id, user_input, corrected_response, priority,
                            never_decay, effectiveness_score,

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill documents file read/write behavior and persistent storage, but it does not declare any explicit tool scope such as permissions or allowed-tools. That creates an authorization ambiguity where a host system or reviewer cannot clearly constrain what filesystem access the skill requires, increasing the chance of overbroad file access or unsafe deployment assumptions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is designed to log user inputs, agent responses, corrected outputs, and context into persistent storage, but it provides no user-facing notice about privacy, retention, or handling of sensitive data. Because correction logs can easily capture secrets, personal data, or internal prompts, silent long-term collection creates a meaningful privacy and data exposure risk.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explicitly promotes persistent recording of raw user inputs and agent outputs into a long-lived corrections log. In this context, correction content is especially likely to contain pasted prompts, credentials, internal error details, or sensitive business data, so verbatim storage creates a direct retention and exposure path.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documented line format stores verbatim user input, agent response, corrected content, and arbitrary JSON context in every entry, encouraging broad capture of potentially sensitive information. Because context fields are unconstrained, downstream integrations may serialize tokens, paths, error traces, or personal data into a searchable long-lived log, increasing exposure severity.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and user-facing descriptions are written entirely in Chinese, and later CLI help/messages also assume Chinese-only interaction. For a general-purpose skill file, this imposes a specific language/locale without any opt-in, alternative, or documented region-specific constraint.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The schema is designed to retain raw user input, agent output, corrected responses, and context in searchable plaintext, enabling later retrieval and reuse of potentially sensitive data. Because the database is local persistent storage and explicitly supports full-text search, compromise of the host or accidental sharing of the DB can expose a concentrated corpus of sensitive interactions.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The Markdown compatibility log writes complete correction details and context snippets into a human-readable plaintext file, making sensitive content easier to inspect, exfiltrate, or accidentally commit to version control. This duplicates the exposure already present in the database and broadens the attack surface.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The logger persists full correction content to both SQLite and Markdown without any user-facing notice, consent flow, or data-minimization controls. In this skill context, corrections may contain sensitive prompts, private context, or secrets, so silent long-term retention increases privacy and secondary-exposure risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file and class documentation describe a 'correction logger' focused on recording corrections, even with enhanced storage and feedback. However, this method uses stored corrections to analyze a planned action, perform full-text search, compute relevance/combined scores, and decide whether to warn, which goes beyond simple logging into behavioral guidance/retrieval.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The docstring says this is the original 'get_recent_corrections' method and that it returns recent corrections. In reality it calls get_corrections_by_priority(), whose query orders by priority DESC, effectiveness_score DESC, timestamp DESC, so higher-priority older entries may be returned ahead of more recent ones.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script is presented as a migration tool that moves corrections from a Markdown file into SQLite, but it never reads or imports the legacy data. This can mislead operators into believing migration has completed successfully, causing silent data loss, audit gaps, or failure to preserve prior correction records that may be relied on by the agent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and all user-facing messages in this script are written only in Chinese. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The inline comments explicitly state that migration will occur automatically later, while the current script reports completion now. This discrepancy encourages false trust in a no-op migration path and can result in operators deleting or ignoring the original data source before any real synchronization happens.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

Automatic archival increases the lifetime and duplication of logged correction data, but the skill does not describe retention limits, deletion behavior, or the privacy implications of creating archive copies. This makes accidental over-retention more likely and can expand the blast radius if logs are later accessed or exfiltrated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This YAML file contains natural-language comments and description text in Chinese, including the plugin description and section headers. Because the file does not document that the skill is Chinese-only or offer a language/locale choice, it may violate the policy against forcing a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This YAML file uses Chinese-only natural-language comments and labels throughout the configuration example, with no indication that language choice is optional or that the skill is intentionally region-specific. Under the policy rule for natural-language content, forcing a specific language without user opt-in can be a locale-policy violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The documented purpose centers on a correction recorder, yet the code also tracks whether corrections were helpful and computes effectiveness scores over time. This is a meaningful behavioral expansion from plain recording into analytics/feedback management, even though it is related to the same data domain.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.