Back to skill

Security audit

FluidGraph

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it claims, but its file-path input can read arbitrary local files despite documenting a whitelist, so it should be reviewed before use.

Install only if you trust the runtime context and can run it in a sandboxed workspace. Prefer passing inline TOML or known project files, and do not let untrusted prompts choose arbitrary local paths until the path whitelist, extension checks, and file-size limits are enforced consistently.

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
fluid_network/skills/inputs.py:153
Finding
Agent-Callable Analysis Tools Permit Unrestricted Local File Reads## Vulnerability Details **File Location**: `fluid_network/skills/inputs.py:153-156`; `fluid_network/parser.py:133-137` **Vulnerability Type**: Missing filesystem sandbox and path authorization **Risk Level**: Medium ### Vulnerable Code `fluid_network/skills/inputs.py:153-156`: ```python if looks_like_path(text): path = Path(text) if path.is_file(): network, scenarios = parser.load(path) return ResolvedNetwork(network, tuple(scenarios), "path", str(path)) ``` `fluid_network/parser.py:133-137`: ```python path = Path(path) if not path.exists(): raise ConfigError(f"配置文件不存在:{path}") try: raw_bytes = path.read_bytes() ``` ### Technical Analysis The `parse_network`, `analyze_scenario`, and `analyze_all_scenarios` tools accept `network_source` as a string. When the string resembles a path and points to an existing file, `resolve_network_source()` passes it directly to `FluidConfigParser.load()`, which reads the entire file with `Path.read_bytes()`. This path lacks all of the controls claimed by the documented security boundary: - No approved-root or directory-containment check - No canonical path validation - No rejection of traversal paths - No protection against symlinks escaping an approved directory - No `.toml` extension restriction - No file-size limit - No default-deny behavior when a sandbox is not configured Consequently, any file readable by the Skill process can be supplied as `network_source`. The parser may then expose information derived from that file through parsed network summaries or detailed syntax and validation diagnostics. The issue also creates a denial-of-service risk because `read_bytes()` loads the complete target into memory without first enforcing the documented 256 KB limit. The SSH-key reference at `SKILL.md:484` is only a deny-list example and does not itself read or write SSH keys. However, the unrestricted path handling means the implementation does not enforce that documented prohibition. # ...[truncated 1487 chars]
Remediation
## Remediation Suggestions 1. Introduce one centralized file-access policy and require every file-reading entry point to use it. 2. Resolve the requested path with strict canonicalization before reading: ```python requested = Path(value).expanduser().resolve(strict=True) ``` 3. Resolve configured allowed roots and verify containment using `Path.is_relative_to()` rather than string-prefix comparisons: ```python if not any(requested.is_relative_to(root) for root in allowed_roots): raise PathNotAllowed(...) ``` 4. Default to denying all path-based reads when no allowed roots are configured. 5. Permit only the required `.toml` extension for `network_source`. 6. Reject symlinks or ensure that the resolved target remains inside an allowed root. 7. Inspect file metadata before reading and reject files over 256 KB. Also use bounded reads to reduce time-of-check/time-of-use risk. 8. Avoid including file contents in parse errors. Return only sanitized locations and diagnostics. 9. Apply the same controls to CLI JSON loading in `skill_runner.py` if the CLI may process attacker-controlled paths. 10. Add tests covering absolute paths, `../` traversal, symlink escapes, sibling directories with matching prefixes, SSH-key paths, unsupported extensions, oversized files, and operation without configured roots. 11. Update the tool documentation to match the actual registered tool set, or implement the documented sandboxed `read_file` tool without allowing analysis tools to bypass its policy.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
Findings (46)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The claimed domain logic—fluid solving, load requirement evaluation, failure-cause analysis, and loop detection—appears absent according to the finding. In this skill context, that is materially dangerous because the tool is marketed for deterministic engineering assessment, so missing functionality directly increases the chance of incorrect operational or design decisions.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The claimed domain logic—fluid solving, load requirement evaluation, failure-cause analysis, and loop detection—appears absent according to the finding. In this skill context, that is materially dangerous because the tool is marketed for deterministic engineering assessment, so missing functionality directly increases the chance of incorrect operational or design decisions.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The claimed domain logic—fluid solving, load requirement evaluation, failure-cause analysis, and loop detection—appears absent according to the finding. In this skill context, that is materially dangerous because the tool is marketed for deterministic engineering assessment, so missing functionality directly increases the chance of incorrect operational or design decisions.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The claimed domain logic—fluid solving, load requirement evaluation, failure-cause analysis, and loop detection—appears absent according to the finding. In this skill context, that is materially dangerous because the tool is marketed for deterministic engineering assessment, so missing functionality directly increases the chance of incorrect operational or design decisions.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The claimed domain logic—fluid solving, load requirement evaluation, failure-cause analysis, and loop detection—appears absent according to the finding. In this skill context, that is materially dangerous because the tool is marketed for deterministic engineering assessment, so missing functionality directly increases the chance of incorrect operational or design decisions.

Credential Access

High
Category
Privilege Escalation
Content
### 明确禁止

- ❌ 任意系统路径(`C:\Windows\...`)
- ❌ `/etc/passwd`
- ❌ `~/.ssh/id_rsa`
- ❌ 路径穿越(`../../../../etc/passwd`)
- ❌ 与白名单前缀相近的同级目录(`/data-evil` 不是 `/data` 的子路径)
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
### 明确禁止

- ❌ 任意系统路径(`C:\Windows\...`)
- ❌ `/etc/passwd`
- ❌ `~/.ssh/id_rsa`
- ❌ 路径穿越(`../../../../etc/passwd`)
- ❌ 与白名单前缀相近的同级目录(`/data-evil` 不是 `/data` 的子路径)
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- ❌ 任意系统路径(`C:\Windows\...`)
- ❌ `/etc/passwd`
- ❌ `~/.ssh/id_rsa`
- ❌ 路径穿越(`../../../../etc/passwd`)
- ❌ 与白名单前缀相近的同级目录(`/data-evil` 不是 `/data` 的子路径)
Confidence
90% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
该文档标题与全文均以中文呈现,且未说明这是区域性/特定受众限定文档,也未提供用户可选择的语言或本地化选项。按规则,强制特定语言而无用户选择或明确合理说明,属于自然语言层面的语言/locale政策风险。

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Lp3

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

Natural-Language Policy Violations

Medium
Confidence
85% confidence
Finding
The frontmatter comments are written as prescriptive Chinese instructions, and the document provides no indication that language choice is optional or constrained for a justified regional purpose. This can violate language/locale policy because it effectively fixes the skill documentation to a specific language without user opt-in.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The natural-language instructions and explanations in comments are written entirely in Chinese, with no indication that the skill is region-specific or that another language is available. Per the policy, forcing a specific language without user opt-in or justification is a natural-language policy violation.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This file contains extensive natural-language documentation in Chinese, including usage instructions and descriptions of functionality, but does not indicate that the language choice is optional or region-specific. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Natural-Language Policy Violations

Medium
Confidence
86% confidence
Finding
The docstring explicitly frames diagnostics and suggestions as Chinese text, including examples and guidance telling the agent not to parse Chinese messages but still to surface Chinese suggestions to users. This indicates a language-specific behavior without any user opt-in or documented locale justification, which can violate language/locale policy requirements.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The comment states '只给一句中文' and frames Chinese as the required error-message format for agent use, while the file-level docstring also presents user-facing messages in Chinese. This is a natural-language locale policy issue because the skill appears to enforce a specific language without offering user choice or documenting a justified region-specific constraint.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
This Python file contains natural-language documentation and many user-facing exception strings exclusively in Chinese, which effectively forces a specific language for users interacting with parser errors and docs. The policy allows locale constraints only when documented and justified or when users are offered a choice, neither of which appears here.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This file contains natural-language docstrings and result messages exclusively in Chinese, including text likely surfaced to users such as PathResult reasons. Under the stated policy, forcing a specific language without user opt-in or justification is a language/locale policy violation.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
This code file contains natural-language documentation and status/reason messages exclusively in Chinese, including the module docstring and explanatory strings returned to callers. That effectively forces a specific language for users or downstream consumers without offering a choice or documenting a justified locale constraint.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This file contains natural-language descriptions and later user-facing warnings/errors entirely in Chinese, which effectively forces a specific language for consumers of the skill. The policy allows locale constraints only when clearly justified or when the user is offered a choice, neither of which is present here.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This file contains natural-language instructions and diagnostic messages exclusively in Chinese, including the main module description and later user-facing error/suggestion text. Because the skill does not offer a language option or explain that it is intentionally limited to Chinese-speaking users, it may violate language/locale policy requirements.

Static analysis

No suspicious patterns detected.