Back to skill

Security audit

Chess Buddy

Security checks for vulnerabilities and agentic risk

Overview

This chess-analysis skill is purpose-aligned and transparent, with some local resource and input-validation risks users should understand before use.

Install only if you are comfortable letting the agent run python3 and a local Stockfish binary for chess analysis. Avoid using it on untrusted FEN strings with embedded control characters, keep engine limits modest, and treat image-derived positions as uncertain until verified.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/stockfish_fen.py:118
Finding

UCI Protocol Command Injection Through Unvalidated FEN Input

Content
View full analysis
int: engine = locate_engine(args.engine) if not engine: print(json.dumps({"ok": False, "error": "stockfish not found", "install": "Install stockfish or set STOCKFISH_PATH."}, indent=2)) return 3 commands = [ "uci", "isready", f"setoption name MultiPV value {args.multipv}", f"position fen {args.fen}", ] commands.append(f"go depth {args.depth}" if args.depth else f"go movetime {int(args.limit * 1000)}") ``` The resulting commands are sent directly to Stockfish at `scripts/stockfish_fen.py:36-45`: ```python def run_stockfish(engine: str, commands: list[str], timeout: float = 20.0) -> list[str]: proc = subprocess.Popen( [engine], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, encoding="utf-8", errors="replace", bufsize=1, ) assert proc.stdin is not None and proc.stdout is not None out: list[str] = [] for command in commands: proc.stdin.write(command + "\n") proc.stdin.flush() ``` ### Technical Analysis The value of `args.fen` is interpolated directly into a line of the UCI protocol without parsing the FEN or rejecting carriage returns, line feeds, and other control characters. Because each newline delimits a command in UCI, a malicious FEN argument containing an embedded newline can append additional commands to Stockfish. This is not shell-command injection because `subprocess.Popen` uses an argument list and does not invoke a shell. The injection is confined to commands recognized by the selected chess engine. Nevertheless, relevant UCI commands can alter engine options, consume resources, terminate the process, or desy ...[truncated 1574 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/stockfish_fen.py:46
Finding

Ineffective Analysis Timeout and Unbounded Engine Resource Parameters

Content
View full analysis
Remediation
View remediation
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)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The code clearly supports Stockfish-based FEN analysis: it finds a Stockfish binary, sends UCI commands, analyzes a provided FEN, parses engine output, and returns JSON. This matches the 'analyzing FEN positions' part of the description. However, the declared description also says it analyzes 'board images,' and there is no image input handling, OCR, computer vision, or board recognition logic anywhere in the supplied code. The extra engine-check subcommand is a supporting detail, not a mismatch. Therefore the description overstates the implemented capability, making it a mismatch.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill advertises shell-dependent behavior (python3, stockfish, and helper commands) but does not declare any explicit tool scope such as permissions or allowed-tools. That creates an authorization ambiguity where an agent may invoke shell/environment capabilities more broadly than intended, increasing the risk of command execution beyond the narrow chess-analysis use case.

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 · scripts/stockfish_fen.py (reported line 33)May include surrounding context.

python
def run_stockfish(engine: str, commands: list[str], timeout: float = 20.0) -> list[str]:
    proc = subprocess.Popen(
        [engine],
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,