Back to skill

Security audit

memory-audit · AI 记忆机制体检

Security checks for vulnerabilities and agentic risk

Overview

This memory auditor needs review because report exports can overwrite memory files, and crafted filenames can insert executable content into HTML reports.

Prefer a version that protects audited files from export overwrites and escapes HTML filenames. Until then, use fresh report paths outside memory, session, and rule folders; avoid shared temporary paths and symlinks. Use JSON for directories with untrusted filenames, keep reports private, and review recommendations before changing memories.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (3)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The static finding reports that export destinations are opened with unrestricted overwrite semantics, which could destroy memory, session, or resident-rule files if an output path collides with an input or follows a symlink. Report generation itself is expected, but failing to protect audited inputs undermines the explicit promise not to modify memory files; the missing checks and recommendations are otherwise functional gaps, not independent security vulnerabilities. The referenced Python implementation was not supplied, so the overwrite behavior cannot be independently verified here.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: file_read, file_write, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · audit.py (reported line 39)May include surrounding context.

python
def git_log(memory_dir):
    try:
        out = subprocess.run(
            ["git", "-C", memory_dir, "log", "--name-only", "--format=@@@%cI"],
            capture_output=True, text=True, timeout=30).stdout
    except Exception: