Back to skill

Security audit

时空智能分析法

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed research workflow, but it needs review because it loads executable code from an unreviewed local path and caches research data despite weak user control.

Review before installing. The main risk is not obvious malware; it is that normal use can execute Python from another local skill path and retain search data locally. Install only if you trust the referenced local skill environment, are comfortable with cached queries/results under ~/.hermes, and can tolerate Chinese-first output and GitHub CLI/network use.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
scripts/spatiotemporal_fetcher.py:66
Finding

Execution of Mutable External Python Module and Unpinned Dependency Guidance

Content
View full analysis

Vulnerability Details

File Location: scripts/spatiotemporal_fetcher.py, lines 66–68 and 116–121
Vulnerability Type: Insecure third-party dependency loading
Risk Level: Medium

Vulnerable Code

python
def __init__(self):
    try:
        sys.path.insert(0, '/Users/neocross/.hermes/skills/openclaw-imports/academic-workflow/scripts')
        from research import search_openalex, search_arxiv
        self.search_openalex = search_openalex
        self.search_arxiv = search_arxiv
    except ImportError as e:
        print(f"⚠️ academic-workflow unavailable: {e}")
        self.search_openalex = None
        self.search_arxiv = None
python
def __init__(self):
    try:
        from duckduckgo_search import DDGS
        self.DDGS = DDGS
    except ImportError:
        print("⚠️ duckduckgo_search is not installed; pip install duckduckgo-search")
        self.DDGS = None

Technical Analysis

The fetcher prepends a hard-coded, user-specific directory outside the audited project to sys.path and then imports research from that location. Python executes module-level code during import. The external file is not pinned to a reviewed version, checked against an integrity hash, or validated as originating from a trusted Skill installation.

Consequently, the effective code executed by this Skill is not limited to the reviewed project. Any party or process able to place or modify research.py in the referenced directory can cause arbitrary Python code to execute when AcademicSource is initialized.

The DuckDuckGo fallback message additionally recommends installing an unpinned package. Although the script does not automatically perform the installation, following this instruction resolves the package through the user's configured package index without a version constraint or hash. A compromised package release, unsafe package source, or dependency-confusion condition could there ...[truncated 2504 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the hard-coded path modification

    • Delete the sys.path.insert call.
    • Do not load executable dependencies from user-specific or mutable directories outside the reviewed package.
  2. Use a declared and pinned dependency

    • Package the academic-search integration as a normal Python dependency.
    • Pin an exact reviewed version in a lock file.
    • Verify distribution hashes during installation.
  3. Use a trusted cross-Skill interface if direct reuse is required

    • Resolve the dependency through the platform's trusted Skill registry rather than an absolute filesystem path.
    • Validate the Skill identifier, version, installation root, and integrity metadata before loading it.
    • Prefer a constrained subprocess or data-only API over importing another Skill's executable Python module into the current process.
  4. Harden Python module resolution

    • Avoid prepending writable locations to sys.path.
    • Confirm the imported module's resolved path against an allowlisted installation root.
    • Reject symbolic links or path traversal that resolve outside that root.
    • Record and verify a cryptographic digest of the approved module when reproducible packaging is unavailable.
  5. Pin the DuckDuckGo package

    • Replace the generic installation message with a documented, reviewed version.
    • Provide a lock file containing hashes for the package and its transitive dependencies.
    • Use a trusted package index explicitly and disable unexpected supplemental indexes where practical.
  6. Fail safely

    • If dependency origin or integrity cannot be validated, disable the affected source and continue with the remaining research sources.
    • Emit a clear security error instead of importing code from an unverified location.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (22)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

There is a substantial description-behavior mismatch. The declaration describes a comprehensive research/analysis skill and workflow for producing spatiotemporal deep research reports, including retrieval, comparative reasoning over time, delivery modes, output formatting, and engineering pipeline components. The supplied code instead only audits an already-written local report file using regex-based heuristics. While some checks loosely relate to report quality in a spatiotemporal analysis context (timestamps, sources, speculation labels), they are supporting audit checks rather than the declared primary capability. No retrieval, comparative analysis, report generation, PDF creation, sub-agent orchestration, or data collection functionality is present.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The description presents a comprehensive analysis framework and reporting system, while the code chunk implements a narrow subset: source retrieval and caching. The fetcher does support part of the declared domain (collecting data for longitudinal and cross-sectional research), so it is related, but it materially underdelivers relative to the declared purpose. The primary behavior is not full analysis; it is preprocessing/data gathering. This is a description-behavior mismatch because the declared capability set is much broader and more operationally ambitious than what the code actually does.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill references shell commands, file operations, network retrieval, and local-path access patterns, but does not declare any explicit tool scope or permission boundaries. In an agent environment, that creates an authorization ambiguity: the router or operator may invoke the skill with broader capabilities than intended, increasing the chance of unsafe file access, command execution, or external data exfiltration.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are broad enough to match ordinary research prompts, which can cause unintended auto-invocation and tool use. In a skill that discusses shell commands, local filesystem inspection, backups, uploading constraints, and multi-step research workflows, overbroad routing increases the chance of the agent entering a higher-capability path when the user only requested a generic analysis.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The invocation section includes very generic patterns like broad 'research' requests, making accidental activation likely. Because the skill content normalizes command-line inspection of local directories and operational workflows, unintended routing could expand the agent's behavior surface beyond the user's expectation and lead to unnecessary local or network actions.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
87% confidence
Finding

The skill explicitly instructs persistence of copied skill directories into hidden storage under ~/.hermes as part of a backup workflow. Even though framed as protective, session-adjacent persistence increases retention of potentially sensitive content, can duplicate data beyond user expectations, and may preserve material that should have been deleted or minimized.

Content

Scanner excerpt · SKILL.md (reported line 386)May include surrounding context.

旧版有而新版缺的每个文件,必须在新版里有等价物

Step 5: 删除前必须先备份(保护性,不是依赖)

mkdir -p ~/.hermes/.-merge-backup-YYYYMMDD/ cp -r <旧版> ~/.hermes/.-merge-backup-YYYYMMDD/v<旧版号> cp -r <第二旧版> ~/.hermes/.-merge-backup-YYYYMMDD/v<第二旧版号>

text

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly documents a local cache under ~/.hermes/spatiotemporal-cache that stores query strings and fetched results on disk for 7 days, but it does not mention user consent, visibility, or handling of potentially sensitive prompts and retrieved content. If users research confidential topics, this can create unintended local data retention and exposure to other local users, backups, endpoint monitoring tools, or later compromise of the host.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The title and opening description explicitly position this as a Chinese PDF recipe, and the rest of the document assumes Chinese fonts and Chinese-language report production. There is no user opt-in or alternative locale path presented, which matches the policy category for language or locale constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

SQP-3 applies to all file types and covers natural-language policy violations such as forcing a specific language without user opt-in. This document presents all instructions in Chinese and does not indicate that users may choose another language or that the skill is intentionally limited to a Chinese-language context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill hard-codes Chinese-only output for all interactions, removing user choice and potentially overriding the user's language or accessibility needs. In an agent setting, this can cause misleading or unusable outputs, especially when users, downstream tools, or review workflows expect another language, and it may silently degrade the safety or correctness of task execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The entire guidance is written as a prescriptive writing baseline in Chinese and does not indicate that the language is optional or limited to a China-specific use case. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module documentation promises that the auditor verifies whether timestamps are current, but the implementation only counts years and dates and never compares them against the present. In a research-auditing workflow, this can create false assurance that stale evidence has been checked for recency, causing outdated claims to pass review and undermining decision quality.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language instructions, description, and usage context are presented in Chinese only, which imposes a language requirement on users without an explicit opt-in or alternative. The policy explicitly calls for flagging language or locale constraints when they are forced rather than user-selectable or justified as region-specific.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The code prepends a hard-coded local filesystem path to sys.path and imports executable functions from another skill at runtime. Because Python executes imported module code, this creates a trust boundary violation: if that external skill or path contents are modified, this skill will execute unintended code outside its declared scope. In an agent-skill environment, cross-skill imports make provenance, review, and sandboxing much weaker.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest describes a spatiotemporal research and analysis workflow with data collection, but it does not indicate any need to execute local programs. This file implements GitHub retrieval by spawning the gh CLI via subprocess.run, which introduces a host-execution capability beyond the obvious needs of a research fetcher when other network-based sources are already used directly in-process.

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/spatiotemporal_fetcher.py (reported line 160)May include surrounding context.

python
import subprocess
        results = []
        try:
            r = subprocess.run(
                ["gh", "search", "repos", query, "--limit", "10",
                 "--json", "name,description,url,stargazersCount,createdAt,updatedAt"],
                capture_output=True, text=True, timeout=30

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file is entirely Chinese-language instructional content and does not mention that the language is configurable or intended only for Chinese-speaking users. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This JSON template is entirely specified in Chinese, including the skill name, section titles, and template text, which implies the skill is designed to produce Chinese-language output by default. There is no indication that users can choose another language or that the locale restriction is justified as region-specific, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The note "arXiv 关键词要英文——中文搜索质量差" directs use of English queries rather than offering language choice or framing it as a recommendation. Under the language/locale policy, forcing a specific language without opt-in can be a natural-language policy violation unless clearly justified and optional.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This is a natural-language policy issue because the file presents its title, purpose, usage context, and later CLI descriptions in Chinese only. There is no opt-in, alternate locale, or stated region-specific justification, so the skill effectively forces a language choice on users.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This code persists fetched results to a local cache directory as JSON, which is a file-write operation covered by the missing user warnings rule for code files. Although the runtime prints the cache path later, the module docstring and argument help do not clearly disclose that search results will be stored on disk by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This manifest-like JSON file defines the skill name, section titles, and templates entirely in Chinese, which indicates a fixed language/locale for generated content. Under the policy, forcing a specific language without offering user opt-in or documenting a justified regional constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.