Back to skill

Security audit

Data Hub

Security checks for vulnerabilities and agentic risk

Overview

This is a plausible trading data hub, but it needs review because its stated access controls are bypassable and it can persist risk data despite describing itself as in-memory.

Install only if you will run it inside a trusted agent process and do not rely on its Agent_ID checks as real security boundaries. Before production use, require trusted caller identity, deep-copy or immutable read results, path-scoped snapshot storage with retention controls, and quotas for symbols, payload size, and stored entries.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
src/data_hub/hub.py:31
Finding

Caller-Controlled Agent Identity Allows Authorization Bypass

Content
View full analysis
dict: if category not in VALID_NAMESPACES: return {"success": False, "error": format_invalid_namespace_error(category)} expected_agent = WRITE_PERMISSIONS[category] if agent_id != expected_agent: return {"success": False, "error": format_permission_error(agent_id, category)} async with self._lock: new_memory, error = self._do_push(category, key, data) ``` ### Technical Analysis The method treats the caller-supplied `agent_id` string as authenticated identity. Authorization consists solely of comparing this string against the expected value in `WRITE_PERMISSIONS`. No trusted session, authenticated execution context, signed token, registered capability, or object identity binds the supplied value to the actual caller. Therefore, any component with access to the `DataHub` object can impersonate: - `Guard_Agent` to modify global risk controls. - `Analyst_Officer` to publish intelligence. - `Default_Orchestrator` to modify market prices and indicators. The checks provide namespace routing policy but do not establish a security boundary. ### Attack Path 1. An untrusted or compromised Agent obtains access to the shared `DataHub` instance. 2. The Agent calls: ```python await hub.push_data( "Guard_Agent", "risk_audit", "global_state", { "global_lock": False, "max_position_allowance": 1000000000.0, "current_drawdown": 0.0, }, ) ``` 3. The method accepts the claimed identity because the string equals the configured writer name. 4. The attacker-controlled risk state replaces the legitimate global risk state. 5. If snapshot persistence is configured, the forged state may also be w ...[truncated 633 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
src/data_hub/hub.py:56
Finding

Mutable Read Results Permit Lock and Authorization Bypass

Content
View full analysis
dict: if category not in VALID_NAMESPACES: return {"success": False, "error": format_invalid_namespace_error(category)} async with self._lock: data = self._do_get(category, key) if data is None: return {"success": False, "error": format_not_found_error(category, key)} return {"success": True, "data": data} ``` The namespace getters return references to objects stored directly in `_memory`: ```python def get(memory: dict) -> dict | None: return memory.get("risk_audit", {}).get(RISK_AUDIT_KEY) ``` ```python def get(memory: dict, symbol: str) -> dict | None: return memory.get("indicators", {}).get(symbol) ``` The summary API only performs shallow copies: ```python summary = { NAMESPACE_MARKET_STATE: {**cleaned_memory[NAMESPACE_MARKET_STATE]}, NAMESPACE_INDICATORS: {**cleaned_memory[NAMESPACE_INDICATORS]}, NAMESPACE_INTELLIGENCE: {**cleaned_memory[NAMESPACE_INTELLIGENCE]}, NAMESPACE_RISK_AUDIT: {**cleaned_memory[NAMESPACE_RISK_AUDIT]}, } ``` ### Technical Analysis `get_data()` releases the lock and returns the same nested dictionary held by `_memory`. A caller can mutate that dictionary or any nested list without calling `push_data()`. `get_summary()` copies only the top-level namespace dictionaries. Their nested dictionaries and lists remain shared references, so modifying the returned summary can also modify internal state. These mutations bypass: - Namespace writer authorization. - Pydantic and custom validation. - The `asyncio.Lock`. - Risk snapshot handling. - Normal update and cleanup logic. ...[truncated 1469 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/data_hub/models.py:10
Finding

Unbounded Namespace Cardinality and Payload Sizes Enable Memory Exhaustion

Content
View full analysis
str | None: if not isinstance(data, dict): return "[VALIDATION_ERROR] Expected dict for indicators data. Please fix and retry." for key, values in data.items(): if not isinstance(key, str): return f"[VALIDATION_ERROR] Indicator key must be string, got {type(key).__name__}. Please fix and retry." if not isinstance(values, list): return f"[VALIDATION_ERROR] Indicator '{key}' values must be a list, got {type(values).__name__}. Please fix and retry." for i, v in enumerate(values): if not isinstance(v, (int, float)): return f"[VALIDATION_ERROR] Indicator '{key}' value at index {i} must be float, got {type(v).__name__}. Please fix and retry." return None ``` New symbols and indicator names are retained without namespace-level quotas: ```python def push(memory: dict, symbol: str, data: dict) -> tuple[dict, str | None]: error = _validate_indicators(data) if error is not None: return memory, error indicators = memory.get("indicators", {}) existing = indicators.get(symbol, {}) merged = {**existing} for key, new_values in data.items(): old_values = merged.get(key, []) combined = [*old_values, *new_values] ...[truncated 2182 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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
Findings (20)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

A second independently reported mismatch confirms the same core issue: the skill claims to avoid persistence and historical storage while apparently saving and loading snapshots from the filesystem. In a crypto trading context, persisted market, intelligence, and risk data can expose sensitive strategy state and undermine assumptions about ephemeral operation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

A second independently reported mismatch confirms the same core issue: the skill claims to avoid persistence and historical storage while apparently saving and loading snapshots from the filesystem. In a crypto trading context, persisted market, intelligence, and risk data can expose sensitive strategy state and undermine assumptions about ephemeral operation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This namespace is documented as an in-memory shared data hub, yet it exposes arbitrary filesystem persistence via save_snapshot/load_snapshot. That expands the trust boundary from transient memory to host file I/O, enabling unintended storage of sensitive risk data and potentially reading attacker-chosen files if untrusted path input reaches these functions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly mandates Chinese for communication and comments regardless of user preference, which can override caller intent and create instruction-priority conflicts in a multi-agent system. In security-sensitive trading workflows, forced language switching can degrade operator comprehension, reduce auditability for non-Chinese reviewers, and increase the chance that warnings, validation errors, or risk annotations are misunderstood or ignored.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description and main usage instructions are primarily written in Chinese, which effectively imposes a language requirement on users and agents interacting with the skill. Under the policy, locale or language constraints should either be optional/opt-in or clearly justified as region-specific, which is not stated here.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documented risk_audit namespace explicitly includes persisted snapshots despite the manifest stating the skill is not for persistent storage. This inconsistency is dangerous because risk-control state is sensitive in a trading system; persisting it without clear declaration can leak account protection thresholds, drawdown state, and operational controls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The spec says expired intelligence content should be forcibly replaced with '[EXPIRED] Analyst report is outdated.' instead of preserving the original value with metadata. This silently mutates user-visible/shared data, which can destroy provenance, mislead other agents about what was originally written, and make audits or debugging of trading decisions harder.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The text says validation failures should return a clear English explanation because English guides the model more precisely. This is a language policy constraint expressed in natural language, and the file does not offer the user any language or locale choice or document a justified region-specific requirement.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation explicitly states that the risk_audit namespace uses '持久化快照' (persistent snapshots), which conflicts with the skill manifest saying the skill is not for persistent storage. This mismatch can lead implementers or downstream agents to retain sensitive risk-control state longer than intended, increasing data retention and misuse risk in a shared trading system.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Unjustified file read/write capability in a runtime shared-memory component increases attack surface without being necessary for its stated purpose. In an agent system, any reachable file I/O primitive can be abused for local file overwrite, sensitive data exposure, or policy bypass when other agents can influence the path or contents.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The tests explicitly validate snapshot save/load behavior for the risk_audit namespace, which introduces disk persistence into a skill described as an in-memory shared data hub and explicitly 'NOT for' persistent storage. This expands the trust boundary: sensitive risk state can be written to and read from the filesystem, creating opportunities for unintended data retention, tampering, or misuse by other components.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Testing of arbitrary path-based save/load operations shows the skill has file read/write capability unrelated to its stated purpose of transient data sharing. In an agent environment, unjustified filesystem access increases attack surface because an attacker or misbehaving agent may cause sensitive state to be persisted, overwritten, or loaded from untrusted files.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The SKILL.md documents lazy cleanup behavior that changes intelligence content to a fixed "[EXPIRED]" string rather than simply excluding or marking stale data. This materially alters shared content and blurs the stated role of the hub as a validated memory-sharing layer for market, indicators, intelligence, and risk state.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest description is written only in Chinese ("数字货币量化交易系统的内存数据中枢 Skill"), which suggests a fixed language/locale choice without indicating user opt-in or a documented region-specific requirement. Under the language/locale policy rule, this is a natural-language policy concern because no alternative language choice or justification is provided in the file.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: pydantic has 4 known advisory(ies) (CVE-2021-29510 (Use of "infinity" as an input to datetime and date fields causes infinite loop i); CVE-2024-3772 (Pydantic regular expression denial of service); CVE-2021-29510 (Pydantic is a data validation and settings management using Python type hinting.) +1 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
85% confidence
Finding

The dependency on pydantic is only constrained as >=2.0, so builds may resolve to versions with known vulnerabilities depending on install time and environment. In a shared in-memory data hub that validates and transports agent-controlled data, a vulnerable parser/validator library could expose the system to denial of service or other input-driven attacks.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: pytest has 2 known advisory(ies) (CVE-2025-71176 (pytest has vulnerable tmpdir handling); CVE-2025-71176 (pytest has vulnerable tmpdir handling)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: setuptools has 10 known advisory(ies) (CVE-2013-1633 (Setuptools vulnerable to Man-in-the-middle attacks); CVE-2025-47273 (setuptools has a path traversal vulnerability in PackageIndex.download that lead); CVE-2024-6345 (setuptools vulnerable to Command Injection via package URL) +7 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code embeds user-facing field descriptions entirely in Chinese, such as "最新成交价" and "当前允许的最大下单量". That creates a locale-specific experience without any indication of user choice or a documented region-specific requirement, which matches the language/locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The test constructs an IntelligenceModel with the content string "BTC看涨", which is Chinese-language text embedded directly in the file. Because the policy category applies to all file types and there is no indication here of user opt-in or a documented region-specific reason, this may reflect an implicit language preference in natural-language content.

Content

No source excerpt is available for this finding.