Back to skill

Security audit

server-log-analyzer

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local log-file analyzer that reads a user-specified log and reports errors, with no evidence of network access, persistence, credential theft, or destructive behavior.

Install only if you are comfortable letting the skill read log files you explicitly provide. Avoid running it on very large or highly sensitive logs unless you have reviewed the contents and can tolerate local resource usage during analysis.

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
scripts/log_analyzer.py:244
Finding
Unbounded Memory Consumption When Parsing Large Log Files## Vulnerability Details **File Location**: `scripts/log_analyzer.py`, lines 244-260 **Vulnerability Type**: Uncontrolled resource consumption / memory exhaustion **Risk Level**: Medium ```python last_entry = None with open(self.log_file, 'r', encoding='utf-8', errors='ignore') as f: for line_num, line in enumerate(f, 1): line = line.strip() if not line: # Empty lines may also mark the end of an exception self.exception_tracker.process_line(line, line_num, last_entry) continue entry = self.parse_line(line, line_num) if entry: self.entries.append(entry) last_entry = entry else: # Nonstandard log lines, such as tracebacks, are still inspected self.exception_tracker.process_line(line, line_num, last_entry) ``` ### Technical Analysis The analyzer processes the input incrementally but retains every successfully parsed log entry in `self.entries`. Each entry contains the full message and other parsed fields. Additional collections, including issue lists, exception records, performance data, and module statistics, may retain references or copies derived from the same input. No limit is imposed on input file size, line length, parsed-entry count, traceback size before finalization, or total memory consumption. Consequently, memory usage grows approximately in proportion to attacker-controlled input size. Calling `line.strip()` also creates a new string for each line, and an exceptionally long individual line can cause a significant temporary allocation. This is especially relevant because arbitrary or large log files are the intended input to the Skill. The documentation only warns that files larger than 10 MB may take longer; it does not enforce a safe upper bound. ### Attack Path 1. An attacker creates or influences a log file containing a very large number of syntactically valid ent ...[truncated 1177 chars]
Remediation
## Remediation Suggestions - Replace full-entry retention with streaming aggregation. Update counters, time ranges, performance statistics, and module statistics as each line is parsed rather than storing every entry. - Retain only a configurable, bounded number of examples for each issue category and exception type, such as the first or most recent three records. - Enforce a configurable maximum input size before opening the file. Reject oversized files with a clear error or require explicit user authorization to process them. - Enforce maximum line and message lengths. Read bounded chunks or truncate oversized messages before parsing and storing them. - Bound traceback accumulation while processing it, rather than truncating only when the exception is finalized. - Cap the number of stored exceptions and source-file frames. - Catch `MemoryError` at the command-line boundary and terminate cleanly with a nonzero exit status, while recognizing that prevention through strict bounds is preferable. - Document resource limits and provide configuration options suitable for constrained Agent or container environments.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (8)

Ae1

High
Category
analysis-evasion
Content
python scripts/log_analyzer.py /path/to/your/logfile.log
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
python scripts/log_analyzer.py /path/to/your/logfile.log
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Vague Triggers

Medium
Confidence
93% confidence
Finding
The trigger list includes broad phrases such as "debug", "exception", "crash", and "server logs", which can cause the skill to activate in many unrelated conversations. In an agent environment, unintended activation can expose user-provided logs or steer workflows into this skill unexpectedly, increasing the chance of data over-collection or incorrect tool invocation.

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger list contains broad phrases like "debug," "exception," and "server logs" that can match ordinary conversation and cause unintended invocation. In a skill that reads files, accidental activation increases the chance of unnecessary access to local log data, potentially exposing sensitive operational or personal information without clear user intent.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
This code file contains natural-language descriptions entirely in Chinese, and the command usage/help and printed report are also fixed to Chinese. Under the policy, forcing a specific language without offering a user choice or documenting a justified locale constraint is a natural-language policy violation.

Natural-Language Policy Violations

Low
Confidence
77% confidence
Finding
The invocation examples prominently include Chinese-only trigger phrases, but the README does not state whether users may interact in other languages or choose their preferred locale. This can create an implicit language expectation without explicit opt-in or documented language selection behavior.

Natural-Language Policy Violations

Low
Confidence
91% confidence
Finding
This markdown file presents all operational guidance in Chinese and does not indicate that the skill is region-specific or that users may choose another language. Under the policy rule for language or locale constraints, forcing a single language without opt-in is a natural-language policy concern.

Static analysis

No suspicious patterns detected.