Back to skill

Security audit

Daily Stock Analysis v2.1

Security checks for vulnerabilities and agentic risk

Overview

This stock-analysis skill has a coherent purpose, but its helper scripts can install and run mutable, unaudited code from GitHub and handle credentials and outbound reports with weak scoping.

Review before installing. Prefer using only the reviewed local package code, avoid running scripts/setup.sh or scripts/update.sh unless the upstream repository is pinned to a reviewed commit, and do not run the scripts as root. Put only least-privilege API keys and webhook credentials in config files, keep push.enabled false until you intentionally configure a channel, and remove any .env backup files that contain secrets. Treat any AI analysis and pushed reports as data shared with third-party services.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/setup.sh:25
Finding

Installer retrieves and executes mutable code outside the audited package

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
requirements.txt:2
Finding

Open-ended dependency constraints allow unreviewed package versions to execute during installation

Content
View full analysis
=1.12.0 pandas>=2.0.0 numpy>=1.24.0 requests>=2.31.0 openai>=1.0.0 python-dotenv>=1.0.0 yfinance>=0.2.0 markdown-to-image>=1.0.0 ``` The installer resolves and installs these mutable dependency ranges: ```bash "$VENV_DIR/bin/pip" install -q -r requirements.txt ``` The updater uses the system-selected `pip3` rather than explicitly using the project virtual environment: ```bash pip3 install -q -r requirements.txt ``` ### Technical Analysis Every declared dependency uses an open-ended lower bound. A future version satisfying the constraint can therefore be installed without having been tested or reviewed with this Skill. No lock file, exact versions, hashes, index restrictions, or artifact verification is provided. Python package installation can execute package build logic and installs code that will later execute through imports. If a dependency release or its package registry account is compromised, the malicious release may be selected automatically. The risk is amplified in `update.sh`, where `pip3` may refer to a user-wide or system environment rather than the virtual environment created by `setup.sh`. The `markdown-to-image` dependency is declared even though no import or use was identified in the reviewed scripts, increasing supply-chain exposure beyond the minimum required functionality. ### Attack Path 1. An attacker compromises a declared dependency's package registry account, release process, or transitive dependency. 2. The attacker publishes a malicious version that satisfies the `>=` constraint. 3. A user performs a fresh installation or runs the updater. 4. Package resolution selects the malicious version. 5. Malicious build or installation behavior runs during installation, or mali ...[truncated 673 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/update.sh:20
Finding

Credential-bearing configuration can be exposed through plaintext backups and missing ignore protection

Content
View full analysis
`. 4. The backup inherits permissions according to the process umask and remains indefinitely. 5. A local user with sufficient file access, a backup service, an archive operation, or an accidenta ...[truncated 671 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (84)

Tainted flow: 'proxies' from os.environ.get (line 88, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
95% confidence
Finding

The Gemini path reads HTTPS proxy settings directly from environment variables and uses them for outbound API calls. If the runtime environment is attacker-controlled or untrusted, requests containing prompts, stock data, and the API key-bearing request context can be routed through a malicious proxy, enabling interception or manipulation of transmitted data.

Content

Scanner excerpt · scripts/ai_analyzer.py (reported line 90)May include surrounding context.

python
if proxy_url:
            proxies = {'https': proxy_url, 'http': proxy_url}
        
        response = requests.post(url, headers=headers, params=params, json=data, timeout=30, proxies=proxies)
        response.raise_for_status()
        
        result = response.json()

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

该描述明显高估了此代码片段的实际能力。代码文件自身注释即表明是“Agent 问股模块(简化版)”,核心行为是基于关键词的意图分类与静态模板/预置列表返回结果。虽然配置中包含 api_key、provider、model、base_url 等字段,但没有任何网络请求或LLM调用。所谓‘分析股票’也只是从问题中提取6位数字代码并返回提示‘使用 analyze_stock() 函数进行详细分析’,并未执行分析。代码也没有实现每日分析流程、复盘、仪表盘、推送、跨市场完整支持或技术面/基本面综合分析。因此,声明的系统级、完整版、LLM驱动、多能力描述与该代码片段的实际行为存在实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个完整的、多功能的股票分析系统,而给出的代码片段只是 fundamental.py 基本面分析子模块。该模块主要格式化A股代码,并通过 AkShare 拉取部分估值和资金流向数据;盈利、成长性、机构持仓仅返回“需配置 Tushare Token 获取详细数据”的占位信息,没有真正完成。代码没有出现LLM调用、技术面分析、港股/美股处理、仪表盘、复盘、板块分析、问答Agent或推送相关实现。因此,代码实际行为与声明的整体用途存在明显不匹配,属于声明远大于实际实现范围。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

该代码块与声明存在明显的描述-行为不匹配。代码文件本身标注为“大盘复盘模块”,其核心功能是通过 akshare/yfinance 获取A股和美股主要指数数据、简单涨跌停统计,并格式化为文本报告。这属于声明中的一个子功能,但远不能支撑“完整版每日股票分析系统”的整体描述。尤其是港股支持、LLM驱动分析、Agent问股、技术面与基本面综合分析、板块分析、仪表盘和推送能力,在该代码中均未出现。虽然单个代码块可能只是整个系统的一部分,但就“所 supplied code chunk 实际做什么”而言,它明显比声明范围窄得多,且缺失多个关键宣称能力,因此应判定为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个功能完整、范围较广的股票分析系统,而提供的代码片段只是其中一个独立的技术分析器脚本。它只对单只股票的历史行情数据进行技术指标分析和交易信号生成,属于技术面子模块。代码没有显示任何LLM调用、外部数据源整合、基本面指标处理、市场级/板块级分析、交互式问股Agent、仪表盘展示或消息推送逻辑。因此,若将这段代码视为对整体技能能力的代表,则声明明显夸大,存在描述与实际行为不一致。

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/ai_analyzer.py (reported line 174)May include surrounding context.

python
只输出 JSON,不要其他内容。"""
        
        return prompt
    
    def _parse_ai_response(self, text: str, tech: Dict[str, Any]) -> Dict[str, Any]:
        """解析 AI 响应"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/run.sh (reported line 23)May include surrounding context.

sh
# 检查环境变量配置
if [ ! -f "$PROJECT_DIR/.env" ]; then
    echo "❌ 错误: 未找到 .env 配置文件"
    echo "请执行: cd $PROJECT_DIR && cp .env.example .env"
    echo "然后编辑 .env 配置 API Key 和股票列表"
    exit 1

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/run.sh (reported line 25)May include surrounding context.

sh
# 检查环境变量配置
if [ ! -f "$PROJECT_DIR/.env" ]; then
    echo "❌ 错误: 未找到 .env 配置文件"
    echo "请执行: cd $PROJECT_DIR && cp .env.example .env"
    echo "然后编辑 .env 配置 API Key 和股票列表"
    exit 1

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/setup.sh (reported line 50)May include surrounding context.

sh
# 检查环境变量配置
if [ ! -f "$PROJECT_DIR/.env" ]; then
    echo "❌ 错误: 未找到 .env 配置文件"
    echo "请执行: cd $PROJECT_DIR && cp .env.example .env"
    echo "然后编辑 .env 配置 API Key 和股票列表"
    exit 1

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/run.sh (reported line 22)May include surrounding context.

sh
cd "$PROJECT_DIR"

# 备份当前配置
if [ -f ".env" ]; then
    echo "→ 备份当前配置..."
    cp .env .env.backup.$(date +%Y%m%d_%H%M%S)
fi

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/run.sh (reported line 24)May include surrounding context.

sh
cd "$PROJECT_DIR"

# 备份当前配置
if [ -f ".env" ]; then
    echo "→ 备份当前配置..."
    cp .env .env.backup.$(date +%Y%m%d_%H%M%S)
fi

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/setup.sh (reported line 49)May include surrounding context.

sh
cd "$PROJECT_DIR"

# 备份当前配置
if [ -f ".env" ]; then
    echo "→ 备份当前配置..."
    cp .env .env.backup.$(date +%Y%m%d_%H%M%S)
fi

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/update.sh (reported line 20)May include surrounding context.

sh
cd "$PROJECT_DIR"

# 备份当前配置
if [ -f ".env" ]; then
    echo "→ 备份当前配置..."
    cp .env .env.backup.$(date +%Y%m%d_%H%M%S)
fi

Credential Access

High
Category
Privilege Escalation
Confidence
69% confidence
Finding

Automatically copying .env creates an additional plaintext secret file, increasing the attack surface and the chance of accidental disclosure through backups, packaging, or misconfigured file permissions. In a stock-analysis skill, API keys or broker/data-provider credentials in .env could enable unauthorized access to financial data services or downstream integrations if the backup is exposed.

Content

Scanner excerpt · scripts/update.sh (reported line 22)May include surrounding context.

sh
# 备份当前配置
if [ -f ".env" ]; then
    echo "→ 备份当前配置..."
    cp .env .env.backup.$(date +%Y%m%d_%H%M%S)
fi

# 拉取最新代码

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown file is written entirely in Chinese and provides no indication that users may choose another language or that the locale restriction is intentional and justified. Under the policy, language or locale constraints should be opt-in or clearly documented as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The top-level description states the skill provides analysis and AI decision advice in Chinese, and the examples throughout the README use fixed Chinese output labels and recommendations. There is no indication that users can opt into another language or that the Chinese-only behavior is a justified region-specific requirement.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README documents use of external AI and market-data integrations but does not clearly warn users that stock symbols, prompts, analysis context, and possibly configuration-derived metadata may be sent to third-party services. In a finance-related skill, that omission matters because users may assume analysis stays local while their watchlists or trading interests are disclosed externally.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The README explicitly configures a third-party API endpoint at api.deepseek.com, indicating data will leave the local environment. External transmission is not inherently malicious, but in this skill context it can expose stock symbols, prompts, or user strategy context to an outside provider without sufficiently prominent disclosure or guidance on data minimization.

Content

Scanner excerpt · README.md (reported line 87)May include surrounding context.

md
"ai": {
    "provider": "openai",
    "api_key": "sk-your-deepseek-key",
    "base_url": "https://api.deepseek.com/v1",
    "model": "deepseek-chat"
  }
}

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises capabilities that inherently require sensitive operations such as network access, file access, environment secrets, and shell usage, but it does not declare any explicit tool scope or permission boundaries. In an agent environment, this increases the risk of over-privileged execution, unintended secret exposure, or arbitrary command/network activity if the runtime grants broad defaults.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger phrases such as '股票分析', '每日分析', and '问股' are very broad and likely to activate during ordinary financial conversation. In an agent platform, overly broad triggers can cause accidental invocation of a skill with network access, data retrieval, or outbound push behavior, increasing the chance of unintended actions or data disclosure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill prominently advertises multi-channel pushing to Feishu, WeChat, Telegram, Discord, and email, but it does not warn that generated reports or contextual data may be transmitted to third-party services. In agent settings, users may not realize that prompts, model outputs, stock lists, or other contextual information could leave the local environment, creating privacy and data-governance risk.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The configuration includes a third-party API endpoint for DeepSeek, which means prompts, analysis inputs, and possibly user-provided financial queries may be transmitted off-platform. External transmission is contextually expected for an AI-powered analysis skill, but it remains security-relevant because sensitive data may be sent to an external processor without explicit minimization, disclosure, or boundary controls.

Content

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

md
"ai": {
    "provider": "openai",
    "api_key": "sk-your-deepseek-key",
    "base_url": "https://api.deepseek.com/v1",
    "model": "deepseek-chat"
  },
  "data": {

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code defines the agent description and all user-facing interactions in Chinese only, with no opt-in or fallback for other languages. That creates a natural-language policy concern when a skill forces a specific language without giving the user a choice or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · config.example.json (reported line 5)May include surrounding context.

json
self.provider = config.get('provider', 'openai')
        self.api_key = config.get('api_key', '')
        self.model = config.get('model', 'deepseek-chat')
        self.base_url = config.get('base_url', 'https://api.deepseek.com/v1')
        self.temperature = config.get('temperature', 0.3)
        self.max_tokens = config.get('max_tokens', 4096)

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/agent.py (reported line 51)May include surrounding context.

python
self.provider = config.get('provider', 'openai')
        self.api_key = config.get('api_key', '')
        self.model = config.get('model', 'deepseek-chat')
        self.base_url = config.get('base_url', 'https://api.deepseek.com/v1')
        self.temperature = config.get('temperature', 0.3)
        self.max_tokens = config.get('max_tokens', 4096)