Back to skill

Security audit

日志压缩器

Security checks for vulnerabilities and agentic risk

Overview

The skill is mainly a log compressor, but it asks for file-writing and command execution while using broad triggers, persistent memory edits, file moves, and misleading security/API claims.

Review carefully before installing. Only use it on non-sensitive logs, require a preview before writing to MEMORY.md or moving files, do not run it as administrator, and verify the missing compressor script before allowing execution.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:341
Finding

Unnecessary Administrator Execution Guidance Violates Least Privilege

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 341
Vulnerability Type: Unnecessary privilege escalation guidance
Risk Level: Medium

Vulnerable Snippet

The complete affected table row, translated into English, is:

markdown
| Insufficient permissions | The current user lacks read/write permissions | Check file permissions and run as administrator |

Technical Analysis

The troubleshooting instructions recommend running the operation as an administrator whenever the current user lacks file permissions. This is broader than necessary for the documented task, which only requires limited access to selected log files, a temporary output file, MEMORY.md, and an optional archive directory.

Running the Agent, Node.js process, or compression script with administrator or root privileges gives it access beyond the legitimate requirements of log compression. This violates the principle of least privilege and increases the security consequences of implementation defects, unsafe path handling, malicious input, or later compromise of the referenced script.

The project does not include the required memory-compress.js implementation, so no direct privileged code-execution exploit can be demonstrated from the supplied artifact. Nevertheless, the instruction itself creates an unsafe operational path when the Skill is deployed with that required script.

Attack Path

  1. The compression process encounters a read or write permission error.
  2. The operator follows the documented troubleshooting advice and reruns the Agent, shell, or Node.js process with administrator or root privileges.
  3. The referenced compression script and its file-processing operations consequently execute in the elevated security context.
  4. If the script contains an implementation flaw, is replaced, or processes an unsafe path or maliciously crafted input, that behavior executes with elevated permissions.
  5. The resulting access ...[truncated 682 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the recommendation to run the Agent or compression process as an administrator.
  2. Identify the exact file or directory that caused the permission failure before changing permissions.
  3. Grant only the invoking user narrowly scoped read access to input logs and write access to the designated output, memory, and archive locations.
  4. Correct file ownership where appropriate instead of applying broad permissions or executing the entire process with elevated privileges.
  5. Reject paths outside explicitly approved project and temporary directories.
  6. Run the compression process under a dedicated unprivileged account where automation is required.
  7. Avoid permissive fixes such as globally writable files or directories.
  8. Add a startup permission check that reports the specific inaccessible path and the minimum permission required.
  9. Audit the missing memory-compress.js implementation before distribution, particularly its path validation, temporary-file handling, and command-execution behavior.
  10. Replace the affected troubleshooting entry with guidance such as: “Verify ownership and grant the current user only the read or write permission required for the identified project path.”
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The security section claims encrypted storage and transmission for logs, but the documented implementation only reads, writes, appends, and moves plaintext local files and provides no encryption mechanism. This creates a false sense of protection around potentially sensitive logs, which can lead operators to store confidential data insecurely under incorrect assumptions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The invocation guidance is broad enough that ordinary conversation about AI models, orchestration, or LLM applications could trigger the skill without clear user intent. In a skill that can read, write, and execute commands, ambiguous triggering increases the chance of unintended file modification or command execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation instructs appending compressed output to MEMORY.md and updating a maintenance timestamp, but does not prominently warn that this modifies persistent project memory. Users may not realize the action is stateful and durable, which can lead to silent corruption, contamination of long-term context, or accidental retention of sensitive information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The archive step moves original logs to another directory without clearly warning users that the source files will be relocated and operational workflows may break if they expect the originals to remain in place. For sensitive or audit-relevant logs, silent relocation can also complicate retention, discovery, and recovery expectations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The example trigger phrase '今天的日志太长了,帮我压缩归档' is generic and plausible in normal conversation, making accidental activation more likely. Because the skill is documented to write to MEMORY.md and manipulate files, an unintended trigger could cause persistent state changes without deliberate consent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The phrase '把这周的日志都压缩了' is especially risky because it is broad and implies batch processing across multiple files. In context, the skill supports loops, file writes, appends, and moves, so an accidental or ambiguous invocation could trigger large-scale persistent changes to memory and archive files.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

L274 says an "LLM API" is a required dependency, while L278 states the skill runs locally and "does not call external API." Those statements are in direct tension about whether network/API access is part of operation, which can mislead reviewers about the skill's actual execution model and data exposure.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.