Back to skill

Security audit

Trading Assistant Core

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real educational trading-analysis skill, but its setup instructions and some data paths create review-worthy risks around API keys and market-data integrity.

Install only from reviewed source or pinned artifacts. Avoid the documented Docker ':latest' examples unless you trust the image publisher and are comfortable exposing your .env API keys and watchlist to that container. Use limited, revocable market-data API keys, do not treat generated buy/sell labels as financial advice, and be cautious with A-share results because that path uses unauthenticated HTTP market data.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T08 · Insecure Dependencies

Warning
Location
requirements.txt:5
Finding

Unpinned Dependencies and Mutable Container Images Create Supply-Chain Risk

Content
View full analysis
=2.0.0 numpy>=1.24.0 requests>=2.31.0 python-dateutil>=2.8.2 python-dotenv>=1.0.0 # Environment variable loading ``` `SKILL.md:42-48`: ```bash ## Installation ```bash pip install -r requirements.txt export TWELVE_DATA_API_KEY=your_key export ALPHA_VANTAGE_API_KEY=your_key python3 trading_signals.py ``` ``` `README.md:109-112`: ```text | **Docker** ⭐ | `docker run -it ghcr.io/xuxuclassmate/trading-assistant:latest` | 5 min | | **pip** | `pip install trading-assistant` | 10 min | | **npm** | `npm install -g @xuxuclassmate/trading-assistant` | 10 min | | **Source** | `git clone + pip install -e .` | 15 min | ``` `README.md:137-149`: ```bash # Download example config curl -O https://raw.githubusercontent.com/XuXuClassMate/trading-assistant/main/.env.example cp .env.example .env # Edit .env with your API keys nano .env # or use your favorite editor # Run the container docker run --rm -it \ -v $(pwd)/.env:/app/.env \ -v $(pwd)/watchlist.txt:/app/watchlist.txt \ ghcr.io/xuxuclassmate/trading-assistant:latest \ --help ``` ### Technical Analysis The Python dependencies use open-ended lower-bound constraints and do not provide an immutable lock file or package hashes. A future installation can therefore resolve to dependency versions that were not present during this audit. The documentation also recommends mutable `latest` container tags. A registry owner—or an attacker who compromises the registry account—can replace the image referenced by that tag after the project has been reviewed. The recommended container command mounts a local `.env` file into the container. Consequently, the unaudited image receives ...[truncated 1898 chars]
Remediation
View remediation
``` 6. Publish signed images, provenance attestations, and a software bill of materials. Document how users can verify signatures before execution. 7. Avoid mounting a credential-bearing `.env` file into an image addressed by a mutable tag. Prefer narrowly scoped runtime secrets and read-only mounts where supported. 8. Use least-privilege, revocable API keys with provider-side usage limits. 9. Audit and version-pin the separately distributed npm package before recommending global installation. 10. Keep versioned installation examples synchronized across `SKILL.md`, `README.md`, and release documentation. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
a_stock_data.py:77
Finding

Market Data Is Retrieved over Unauthenticated Plaintext HTTP

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (63)

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

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · portfolio_manager.py (reported line 85)May include surrounding context.

python
"apikey": api_key
        }
        
        response = requests.get(url, params=params, timeout=10)
        response.raise_for_status()
        data = response.json()

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

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · support_resistance.py (reported line 51)May include surrounding context.

python
"apikey": api_key
        }
        
        response = requests.get(url, params=params, timeout=30)
        response.raise_for_status()
        data = response.json()

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

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · trading_signals.py (reported line 54)May include surrounding context.

python
"apikey": api_key
        }
        
        response = requests.get(url, params=params, timeout=30)
        response.raise_for_status()
        data = response.json()

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 · README.md (reported line 139)May include surrounding context.

md
# Download example config
curl -O https://raw.githubusercontent.com/XuXuClassMate/trading-assistant/main/.env.example
cp .env.example .env

# Edit .env with your API keys
nano .env  # or use your favorite editor

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

The README tells users to mount their local '.env' file directly into a container pulled from a mutable remote image. If that image is malicious or compromised, it can read mounted API keys and potentially exfiltrate them, making this a credible credential exposure path.

Content

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

md
# Run the container
docker run --rm -it \
  -v $(pwd)/.env:/app/.env \
  -v $(pwd)/watchlist.txt:/app/watchlist.txt \
  ghcr.io/xuxuclassmate/trading-assistant:latest \
  --help

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

This interactive Docker example mounts '.env' into the container, exposing API credentials to whatever code the image executes. Because the README also promotes running 'latest' images, the combination materially increases the chance of secret theft from users following the setup guide.

Content

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

bash
# Interactive mode in Docker
docker run --rm -it \
  -v $(pwd)/.env:/app/.env \
  -v $(pwd)/watchlist.txt:/app/watchlist.txt \
  ghcr.io/xuxuclassmate/trading-assistant:latest

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

The direct-command Docker example again mounts the local '.env' file into a remotely pulled container. In the context of a trading tool that requires API keys and may handle portfolio data, this creates meaningful credential and privacy exposure if the container is tampered with or behaves unexpectedly.

Content

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

md
# Direct command in Docker
docker run --rm -it \
  -v $(pwd)/.env:/app/.env \
  -v $(pwd)/watchlist.txt:/app/watchlist.txt \
  ghcr.io/xuxuclassmate/trading-assistant:latest \
  ta sig

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

A skill that emits explicit trading recommendations, consumes API keys, performs live network queries, and omits promised portfolio functionality is materially misrepresented. In a finance-related context, such concealment is more dangerous because users may place unjustified trust in recommendations and reviewers may miss the need for stronger controls around external access and credential handling.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

A skill that emits explicit trading recommendations, consumes API keys, performs live network queries, and omits promised portfolio functionality is materially misrepresented. In a finance-related context, such concealment is more dangerous because users may place unjustified trust in recommendations and reviewers may miss the need for stronger controls around external access and credential handling.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

A skill that emits explicit trading recommendations, consumes API keys, performs live network queries, and omits promised portfolio functionality is materially misrepresented. In a finance-related context, such concealment is more dangerous because users may place unjustified trust in recommendations and reviewers may miss the need for stronger controls around external access and credential handling.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

A skill that emits explicit trading recommendations, consumes API keys, performs live network queries, and omits promised portfolio functionality is materially misrepresented. In a finance-related context, such concealment is more dangerous because users may place unjustified trust in recommendations and reviewers may miss the need for stronger controls around external access and credential handling.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A skill that emits explicit trading recommendations, consumes API keys, performs live network queries, and omits promised portfolio functionality is materially misrepresented. In a finance-related context, such concealment is more dangerous because users may place unjustified trust in recommendations and reviewers may miss the need for stronger controls around external access and credential handling.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

A skill that emits explicit trading recommendations, consumes API keys, performs live network queries, and omits promised portfolio functionality is materially misrepresented. In a finance-related context, such concealment is more dangerous because users may place unjustified trust in recommendations and reviewers may miss the need for stronger controls around external access and credential handling.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

A skill that emits explicit trading recommendations, consumes API keys, performs live network queries, and omits promised portfolio functionality is materially misrepresented. In a finance-related context, such concealment is more dangerous because users may place unjustified trust in recommendations and reviewers may miss the need for stronger controls around external access and credential handling.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

A skill that emits explicit trading recommendations, consumes API keys, performs live network queries, and omits promised portfolio functionality is materially misrepresented. In a finance-related context, such concealment is more dangerous because users may place unjustified trust in recommendations and reviewers may miss the need for stronger controls around external access and credential handling.

Content

No source excerpt is available for this finding.

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 · README.md (reported line 141)May include surrounding context.

md
交易助手系统配置管理

Configuration is loaded from:
1. Environment variables (.env file)
2. watchlist.txt (user-defined stock list)
3. config.json (optional, for advanced settings)

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 · README.md (reported line 142)May include surrounding context.

md
交易助手系统配置管理

Configuration is loaded from:
1. Environment variables (.env file)
2. watchlist.txt (user-defined stock list)
3. config.json (optional, for advanced settings)

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 · config.py (reported line 7)May include surrounding context.

python
交易助手系统配置管理

Configuration is loaded from:
1. Environment variables (.env file)
2. watchlist.txt (user-defined stock list)
3. config.json (optional, for advanced settings)

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 · config.py (reported line 12)May include surrounding context.

python
交易助手系统配置管理

Configuration is loaded from:
1. Environment variables (.env file)
2. watchlist.txt (user-defined stock list)
3. config.json (optional, for advanced settings)

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 · config.py (reported line 22)May include surrounding context.

python
交易助手系统配置管理

Configuration is loaded from:
1. Environment variables (.env file)
2. watchlist.txt (user-defined stock list)
3. config.json (optional, for advanced settings)

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 · portfolio_manager.py (reported line 14)May include surrounding context.

python
交易助手系统配置管理

Configuration is loaded from:
1. Environment variables (.env file)
2. watchlist.txt (user-defined stock list)
3. config.json (optional, for advanced settings)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation says this function obtains stock historical data from Twelve Data, which implies behavior consistent with historical time-series retrieval. But the implementation requests 'https://api.twelvedata.com/time' and then expects OHLCV 'values', actively contradicting the documented intent of the function.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The README advertises Feishu, DingTalk, and Email notifications without warning that stock symbols, alert conditions, positions, or other trading metadata may be transmitted to third-party services. This is a real privacy and operational security weakness because users may unknowingly expose sensitive portfolio or strategy information outside their local environment.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding

The README instructs users to pull a container using the mutable ':latest' tag rather than a pinned version digest. If the registry image is replaced, compromised, or unexpectedly changed, users may run unreviewed code with access to mounted files such as configuration and watchlists.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.