Back to skill

Security audit

Triangulate

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed multi-agent analysis orchestrator, but it needs review because it can spawn child agents and persist or restore workflow state with weak file-path controls.

Review before installing. Use it only when you are comfortable with a skill spawning child agents for analysis, and avoid high-risk operational requests unless you can enforce separate authorization. Do not pass untrusted checkpoint names, and treat checkpoints and written reports as potentially sensitive local files.

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
state_machine.py:248
Finding

Unrestricted Checkpoint Paths Allow Arbitrary JSON File Overwrite and Unsafe State Loading

Content
View full analysis

Vulnerability Details

File Location: state_machine.py:248-279
Vulnerability Type: Path traversal, unsafe file handling, and plaintext storage of potentially sensitive workflow state
Risk Level: Medium

Vulnerable Code

python
def save_checkpoint(self, name: Optional[str] = None) -> str:
    """Save the current checkpoint to disk."""
    self.CHECKPOINT_DIR.mkdir(parents=True, exist_ok=True)
    filename = name or f"checkpoint_{int(time.time())}.json"
    filepath = self.CHECKPOINT_DIR / filename

    checkpoint_data = self.checkpoint.model_dump(mode="json")
    with open(filepath, "w", encoding="utf-8") as f:
        json.dump(checkpoint_data, f, ensure_ascii=False, indent=2, default=str)

    # Retain only the latest MAX_CHECKPOINTS checkpoint files.
    all_checkpoints = sorted(
        self.CHECKPOINT_DIR.glob("checkpoint_*.json"),
        key=lambda p: p.stat().st_mtime,
        reverse=True,
    )
    for old_file in all_checkpoints[self.MAX_CHECKPOINTS:]:
        old_file.unlink()

    return str(filepath)

def load_checkpoint(self, name: str) -> bool:
    """Restore a checkpoint from disk."""
    filepath = self.CHECKPOINT_DIR / name
    if not filepath.exists():
        return False

    with open(filepath, "r", encoding="utf-8") as f:
        data = json.load(f)

    self.checkpoint = WorkflowCheckpoint(**data)
    self.current_phase = self.checkpoint.phase
    return True

The checkpoint contains potentially sensitive workflow information:

python
class WorkflowCheckpoint(BaseModel):
    """Workflow checkpoint used for recovery."""
    phase: WorkflowPhase
    tier: Tier
    input_data: Optional[UserInput] = None
    strategy_rounds: List[StrategyRound] = Field(default_factory=list)
    task_dag: Optional[TaskDAG] = None
    execution_report: Optional[ExecutionReport] = None
    review_results: List[DecisionResult] = Field(default_fact
...[truncated 4105 chars]
Remediation
View remediation

Remediation Suggestions

  1. Restrict checkpoint names

    • Accept only a basename matching a strict allowlist, such as checkpoint_[A-Za-z0-9_-]+\.json.
    • Reject absolute paths, path separators, . components, and .. components.
    • Prefer generating checkpoint identifiers internally rather than accepting filenames from callers.
  2. Enforce canonical path containment

    • Resolve the checkpoint directory and candidate path.
    • Verify that the resolved candidate is a descendant of the resolved checkpoint directory before reading or writing.
    • Reject symlinks or open files using operating-system features that prevent symlink following where available.
  3. Harden filesystem permissions

    • Create .triangulate_checkpoints with permissions equivalent to 0700.
    • Create checkpoint files with permissions equivalent to 0600.
    • Do not rely exclusively on the process umask.
  4. Use safe write semantics

    • Write to a securely created temporary file inside the checkpoint directory.
    • Flush and atomically replace the destination after serialization succeeds.
    • Use exclusive creation when overwriting is not explicitly required.
  5. Protect stored data

    • Omit or redact user input, report content, and session identifiers unless they are required for recovery.
    • Encrypt checkpoints when sensitive workflow content must be persisted.
    • Define an explicit retention and secure-deletion policy.
  6. Validate loaded checkpoints

    • Enforce a maximum file size before parsing.
    • Catch JSON decoding, I/O, and Pydantic validation failures.
    • Validate that loaded workflow phases and state transitions are appropriate for recovery.
    • Consider signing checkpoints to prevent unauthorized state modification.

Example containment logic:

python
import re
from pathlib import Path

CHECKPOINT_NAME = re.compile(r"^checkpoint_[A-Za-z0-9_-]+\.json$")

def _safe_ch
...[truncated 370 chars]
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (62)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description promises a full decision engine with three-view consensus, management scheduling, and concurrent execution for complex tasks. The supplied code chunk does not implement those core capabilities. Instead, it is explicitly labeled and implemented as an 'input adapter layer' that parses strings/dicts/UserInput objects, validates them, infers keywords/templates/importance, and logs warnings about configuration consistency. While such input normalization could be a supporting component of a larger engine, this chunk by itself materially differs from the declared primary purpose and lacks the advertised decision, consensus, scheduling, and concurrency behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

该代码块与描述部分吻合于“共识决策/三视角/分歧处理”这一核心方向,但描述明显比实际代码更宽、更强。实际提供的是单一 consensus.py 模块,负责:收集或伪造A/B/C三类决策结果、基于档次/重要性/关键词共享进行阈值判断、分歧时重试或转交用户、以及对执行报告做B/C审阅。它并没有实现描述中提到的“管理层调度”和“执行层并发”能力;这些若存在也不在本代码块内。此外,所谓“拜占庭共识”在实现上只是业务规则式的近似判定,而不是严格的拜占庭容错/分布式共识协议。因此应判定为描述与代码行为存在实质不匹配,但不涉及额外未声明的敏感权限或资源访问。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a high-level decision engine centered on three-view consensus, scheduling, and concurrent execution. However, the supplied code chunk does not implement consensus, decision-making, scheduling, or task execution. It only provides infrastructure for shared workflow state management: atomic context writes, read snapshots, listener notifications, version/history tracking, and reset behavior. While such a context bus could support a larger orchestration system, this code chunk's actual purpose is materially narrower and different from the declared engine behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The description presents a full multi-layer consensus decision engine with three-view/Byzantine consensus, scheduling, and concurrent execution support. The supplied code does not implement consensus or actual execution orchestration; it only handles one intermediate layer: decomposing an already-produced strategy result into subtasks and validating a TaskDAG. While this is related to the broader declared system, the code chunk’s concrete behavior is substantially narrower than the declared purpose, and key headline capabilities in the description are absent from the implementation shown.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The declared description presents a full multi-layer decision engine centered on three-view consensus and Byzantine-style consensus mechanisms for complex reasoning tasks. The supplied code chunk is narrowly focused on execution orchestration: scheduling DAG subtasks by dependency, concurrent execution, retries, timeout handling, cancellation, and reporting. While '执行层并发' is consistent with part of the description, the prominent claimed capabilities—three-perspective consensus, Byzantine consensus, and broader decision-engine behavior—are absent from this code. Therefore the description materially overstates and mischaracterizes what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents a high-level consensus-based decision engine with multiple reasoning/execution layers. The supplied code chunk does not implement consensus, decision-making, scheduling, or task-oriented workflow logic. It only provides a thread-safe wrapper around a PipelineContext using an RLock. While thread safety could be a supporting detail for a larger concurrent system, this chunk by itself materially differs from the declared primary purpose and lacks the core advertised capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description presents the skill as a decision/consensus engine with orchestration across multiple reasoning layers. The supplied code chunk does not implement consensus, task analysis, scheduling, or execution-layer concurrency. Instead, it is a supporting infrastructure module focused on preventing duplicate execution through in-memory caching and hash-based idempotency. While such functionality could support a larger orchestration system, this chunk’s actual primary purpose is materially different from the declared end-user purpose, so this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description presents a full decision engine with three-perspective consensus, management scheduling, and concurrent execution. The supplied code chunk is only a pipeline context/model layer implemented with Pydantic. Its responsibilities are immutable state storage, session bookkeeping, consistency validation, timing, copy-on-write evolution, and checkpoint projection. While these are supporting components for a workflow, they do not themselves realize the core advertised capabilities. Therefore, for this code chunk, the description materially overstates what the code actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个高层次的复杂决策与执行引擎,核心能力应包括多视角共识、调度和并发执行等。当前代码片段并未展示这些核心功能,而是一个独立的输入/输出契约校验器,用于检查流水线各阶段上下文是否满足下一阶段消费要求。虽然这种守卫机制可能是大型决策流水线的辅助组件,但就该代码片段本身而言,其主要目的与声明的核心能力明显不一致,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents the skill as a complex multi-perspective consensus decision engine with layered scheduling and concurrent execution. The supplied code does not implement consensus, multi-agent deliberation, voting, arbitration, or domain task solving. Instead, it provides a Saga pattern workflow utility: add steps, execute them one by one, detect failure or timeout, and compensate prior steps in reverse order. Session spawning/termination appears only as side-effect rollback support, not as a consensus mechanism. This is a materially different primary purpose, so the description does not accurately represent the code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a high-level decision/consensus engine for solving complex analytical tasks. The supplied code does not implement consensus, multi-view decision logic, management-layer scheduling, or concurrent execution orchestration. Instead, it is a support utility focused on tracking side effects (sessions), rolling them back, validating liveness, and recording rollback failures. This is a materially different primary purpose. While such a component could be part of a larger orchestration system, this code chunk itself is not accurately represented by the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a high-level consensus-based decision engine with multiple coordinated layers (three-view consensus, scheduling, concurrent execution) for solving complex analytical tasks. The supplied code chunk instead implements low-level workflow step execution infrastructure: wrapping an action function, updating context, syncing state, tracking side effects, optionally integrating with a Saga rollback mechanism, and enforcing contracts/consistency. These behaviors are materially different from the declared primary purpose, and the hallmark capabilities in the description are absent from the code shown. Therefore this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description advertises an operational 'three-view consensus decision engine' with consensus, scheduling, and concurrent execution capabilities. The supplied code chunk is instead a test module (tests/contract_tests.py) containing pytest cases for Pydantic model validation and a DAG topological sort check. While some schema names suggest a larger system may exist elsewhere (e.g., DecisionResult, TaskDAG, ConsensusOutput), this chunk itself only verifies input constraints and boundary behavior. That is a materially different primary purpose from the declared engine functionality, so this chunk does not accurately represent the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The code chunk does not implement or exercise a consensus-based decision engine. Instead, it is exclusively focused on Saga orchestration semantics and rollback correctness through unit tests. There is no evidence of three-perspective deliberation, Byzantine fault tolerance, consensus voting, scheduling coordination, or concurrent execution. The primary purpose is materially different: transactional workflow compensation testing rather than complex-task decision support. No undeclared sensitive permissions or triggers are visible, but the declared functionality does not accurately describe the actual code behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

The declared description presents a functional decision engine with consensus, scheduling, and concurrent execution capabilities. The supplied code chunk does not implement those behaviors; it is a unit/integration-style test file focused on verifying that a PipelineContext and related schema objects can pass data safely between phases. While the test names and fixtures reference strategy, dispatch, execute, and review phases, the code itself only checks object construction, validation, immutability, session consistency, serialization, and checkpoint roundtripping. That is materially different from the declared primary purpose, so this should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个面向复杂任务的多视角共识决策与调度执行引擎,核心应包含共识决策、调度 orchestration、并发执行等能力。而提供的代码仅是 timeout_manager.py,功能集中在时间记录、阶段计时、超时判断和生成报告。虽然这类超时管理可能是某个工作流系统的辅助组件,但它并不能支撑声明中的主要能力,且代码中没有看到三视角分析、拜占庭共识、任务调度、并发执行等关键实现。因此描述与该代码片段的实际行为存在明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The code does not implement a consensus decision engine or any visible 'three-view' reasoning, Byzantine consensus, scheduling logic, or concurrent execution. Instead, it defines a transactional workflow runner that executes pre-registered steps sequentially, updates shared context, enforces stage guards, tracks side effects, and performs reverse-order rollback through compensating actions when a step fails. This is a materially different primary purpose from the declared description.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

This is a stronger form of the previous issue: the skill's own safety section claims dangerous templates won't execute real actions, yet later task-dispatch instructions tell child agents to read SKILL.md and execute according to the skill definition. In a security context, self-contradictory guidance around high-risk domains materially increases the chance that an operator or downstream agent will perform prohibited actions under a false assumption of safety.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill requests session-spawning capabilities and also documents behaviors that read skill files and write deliverables, but it does not declare an explicit tool scope such as allowed-tools or permissions. This creates an authorization ambiguity where a generic decision skill could gain broader file read/write effects than users expect, especially because later sections instruct agents to read SKILL.md files and write final output files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill description and operational instructions are presented in Chinese, and the file does not indicate that users may choose another language or that the skill is intentionally region-specific. This can violate language/locale policy because it effectively forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

Embedding pentesting, reverse engineering, and crawling templates inside a general-purpose decision-analysis skill expands its effective capability into high-risk operational domains. Even if framed as analysis-only, including these specialized templates in the same dispatcher-enabled skill increases misuse potential and makes accidental activation more dangerous.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document says high-risk templates only provide an analysis framework and do not perform actual operations, but the workflow elsewhere supports real execution-layer dispatch and child-task spawning. This contradiction is dangerous because it lowers operator vigilance around risky domains like crawling, pentesting, and reverse engineering while still defining mechanisms that could operationalize those tasks.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill is presented as a general analysis engine, but the agent instructions explicitly include a write-file delivery step. Hidden or underemphasized file-output behavior can lead to unexpected persistence of potentially sensitive task data, especially when users believe they are only requesting analysis.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill includes file-output behavior but does not clearly warn users that results may be written to files. This can cause unintentional persistence of sensitive prompts, analyses, or derived data on disk, which is especially problematic in shared or regulated environments.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module docstring and user-facing descriptions are exclusively in Chinese, with no indication that the skill supports other languages or that Chinese is an intentional region-specific constraint. The policy explicitly flags language or locale constraints when they are forced without user opt-in or justification.

Content

No source excerpt is available for this finding.