Back to skill

Security audit

Outer Ratio Monitor

Security checks for vulnerabilities and agentic risk

Overview

This stock-alert skill does not show data theft or destructive behavior, but its financial alerts are materially unreliable and advertised monitoring features do not match the shipped code.

Review before installing or relying on this skill. It fetches public Tencent market data and stores local history, but its advertised automatic alerts and webhook delivery are not present, and its core ratio calculation conflicts with the documentation. Do not use its output as a trading trigger without fixing and validating the calculation and alert behavior.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/outer_ratio_monitor.py:61
Finding

Incorrect Outer-to-Inner Volume Ratio Produces Misleading Financial Alerts

Content
View full analysis
0 else 0 ``` The documented calculation in `SKILL.md:329` and `references/outer_ratio_guide.md:18-21` is: ```text Outer-to-inner ratio = outer volume / inner volume ``` ### Technical Analysis The implementation calculates the outer volume as a proportion of total classified volume: ```text outer / (outer + inner) ``` This is not the documented outer-to-inner ratio: ```text outer / inner ``` For nonnegative market-volume values, the implemented result cannot exceed `1.0`. However, `detect_alerts()` treats a result of at least `1.25` as a strong buy-side signal: ```python if data["outer_ratio"] >= ALERT_THRESHOLDS["outer_ratio_strong"]: alerts.append(f"🟢 主力建仓 外内比{data['outer_ratio']:.2f}") elif data["outer_ratio"] <= ALERT_THRESHOLDS["outer_ratio_danger"]: alerts.append(f"🔴 主力出逃 外内比{data['outer_ratio']:.2f}") ``` Consequently, the configured strong threshold is mathematically unreachable. The danger threshold is also applied to a different statistic than the documentation describes. For example, equal outer and inner volumes produce `0.5` in the implementation, causing a danger alert, whereas the documented ratio would be `1.0`, representing balanced volumes. This is a data-integrity vulnerability in a financial monitoring tool. It does not grant an attacker operating-system privileges, but it can corrupt the integrity of the tool's decision-support output. ### Attack Path 1. Tencent's market endpoint returns ordinary outer and inner volume values. 2. The monitor parses those values without tampering. 3. The monit ...[truncated 1145 chars]
Remediation
View remediation
0: outer_ratio = round(outer / inner, 4) elif outer > 0: outer_ratio = float("inf") else: outer_ratio = None ``` 2. Define explicit behavior for zero inner volume rather than silently returning zero. 3. Prevent `None` or infinite values from being formatted or compared without validation. 4. Add unit tests covering: - Equal outer and inner volumes, which should produce `1.0`. - A ratio exactly at `0.50`. - A ratio exactly at `1.25`. - Zero inner volume with nonzero outer volume. - Both values equal to zero. 5. Confirm that Tencent API fields 7 and 8 have the meanings and units assumed by the implementation. 6. Add schema and range validation for all upstream numeric fields before generating alerts. 7. Review existing stored history because previously recorded values use the incorrect formula and are incompatible with corrected values. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/outer_ratio_monitor.py:38
Finding

Advertised Feishu and DingTalk Alert Delivery Is Not Implemented

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/outer_ratio_monitor.py:226
Finding

Monitoring Schedule and Alert-Only Mode Are Nonfunctional

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented behavior materially differs from the implemented behavior, including impossible threshold logic, unimplemented alerting, and nonexistent periodic scheduling. In a trading-related skill, these discrepancies are dangerous because users may rely on false or missing alerts and on incorrect signal calculations, leading to harmful real-world decisions under the mistaken belief that monitoring and warnings are working.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises and documents capabilities that involve network access, file writes, and likely environment-based configuration, but it does not declare any explicit tool scope or permissions. This weakens least-privilege controls and can cause the agent runtime to grant broader access than users expect, increasing the blast radius if the skill is modified, misused, or paired with unsafe code.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The primary description is written entirely in Chinese and presents the skill in that locale by default, with no indication that users can choose another language. This is a natural-language policy concern because the skill appears to impose a specific language experience rather than documenting a justified region-specific constraint or offering opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The package description is entirely in Chinese and framed specifically around the Chinese A-share market, without indicating that the skill is localized by design or offering any language choice. The policy requires flagging language or locale constraints unless they are clearly documented and justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This section presents explicit buy/sell signals such as '跟进买入', '重点关注买入', '减仓', and '止损/规避' as prescriptive actions tied to threshold values, which can cause users to treat the content as actionable investment advice rather than educational commentary. Although the skill metadata includes a general market-risk disclaimer, the table itself lacks local cautionary framing and presents simplified thresholds that may encourage unsafe financial decisions if followed blindly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The practical usage section recommends concrete trading behavior and automated alerting for market moves, including buying, stopping out, filtering candidates, and real-time notifications, which increases the likelihood of rapid user action based on a single indicator. In the context of a stock-trading skill marketed for short-term A-share traders, this is more dangerous because the automation framing and '主力' narrative can overstate predictive reliability and materially influence financial decisions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The natural-language content in the module docstring and inline comments is entirely in Chinese, including setup guidance and configuration descriptions. This imposes a specific language on users without any opt-in, alternative language support, or documented justification that the skill is intended only for a Chinese-speaking or region-specific audience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code file contains natural-language instructions and CLI help oriented exclusively to Chinese speakers, starting with the module docstring and continuing through user-facing output. Under the language/locale policy, forcing a specific language without user opt-in is a policy concern unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring says '--alert-only' means '仅告警', and argparse also advertises that mode, but scan_all never uses the alert_only parameter to change output behavior. As written, passing --alert-only produces the same output as a normal scan, which contradicts the documented intent of that flag.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest says anomalies should trigger immediate Feishu alerts, and the code even reads a FEISHU_WEBHOOK setting, but there is no implementation that posts to Feishu anywhere in the file. The script only prints alerts locally and writes snapshot/history files, so its actual behavior falls short of the claimed alerting functionality.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.