T09 · Insecure Skill Coding Practices
- Location
scripts/stock_analyst.py:298- Finding
Indirect Prompt Injection Through Untrusted Market and Social Content
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill does what it claims: it analyzes US stocks through AIsa APIs, with some normal but important privacy and report-file risks to understand.
Install only if you are comfortable sending stock tickers, watchlists, research queries, and generated analysis context to AIsa and its model providers. Prefer AISA_API_KEY over --api-key, review generated reports before relying on them for financial decisions, and choose output filenames carefully because the script writes JSON reports locally.
scripts/stock_analyst.py:298Indirect Prompt Injection Through Untrusted Market and Social Content
scripts/stock_analyst.py:512API Credential Exposure Through Command-Line Arguments
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Real-time Financial Metrics
curl "https://api.aisa.one/apis/v1/financial/financial-metrics/snapshot?ticker=AAPL" \
-H "Authorization: Bearer $AISA_API_KEY"
The skill advertises and demonstrates use of environment variables, network access, and report output to files, but does not declare any explicit tool scope such as permissions or allowed-tools. That weakens sandboxing and review because a host agent may permit broader capabilities than users expect, especially for a user-invocable skill that sends data to third-party APIs.
The skill encourages users to submit tickers, portfolio holdings, watchlists, and natural-language analysis requests, then routes that data to external financial, search, social, video, and LLM services. Because the description does not clearly warn that user-provided portfolio/watchlist data and prompts are transmitted off-platform, users may unknowingly disclose sensitive financial interests or proprietary research queries.
This skill clearly transmits user-supplied analysis targets to an external API using the bearer token in AISA_API_KEY. External transmission is expected for this skill's function, but it remains a real privacy/security concern because financial interests, research prompts, and derived watchlists may leave the local environment and be processed by a third party.
Real-time Financial Metrics
curl "https://api.aisa.one/apis/v1/financial/financial-metrics/snapshot?ticker=AAPL" \
-H "Authorization: Bearer $AISA_API_KEY"
This skill clearly transmits user-supplied analysis targets to an external API using the bearer token in AISA_API_KEY. External transmission is expected for this skill's function, but it remains a real privacy/security concern because financial interests, research prompts, and derived watchlists may leave the local environment and be processed by a third party.
Real-time Financial Metrics
curl "https://api.aisa.one/apis/v1/financial/financial-metrics/snapshot?ticker=AAPL" \
-H "Authorization: Bearer $AISA_API_KEY"
Historical price queries send user-selected ticker interests and time windows to an external service. While routine for market-data skills, this still exposes user research activity to a third party and should be considered a genuine data-transmission risk, especially for proprietary portfolio workflows.
Historical Stock Prices
# Daily prices for last 30 days
curl "https://api.aisa.one/apis/v1/financial/prices?ticker=AAPL&start_date=2025-01-01&end_date=2025-01-31&interval=day&interval_multiplier=1" \
-H "Authorization: Bearer $AISA_API_KEY"
# 5-minute intraday data
Intraday price requests disclose more granular user interest and timing to the external provider, potentially revealing active trading research patterns. The skill context makes this transmission expected, but not harmless, because repeated fine-grained queries can expose sensitive strategy information.
-H "Authorization: Bearer $AISA_API_KEY"
curl "https://api.aisa.one/apis/v1/financial/prices?ticker=AAPL&start_date=2025-02-07&end_date=2025-02-07&interval=minute&interval_multiplier=5"
-H "Authorization: Bearer $AISA_API_KEY"
Financial statements retrieval is another external transmission channel for user-selected company analysis. The risk is contextual rather than exploit-driven: user research interests and workflow data leave the local agent boundary and are processed externally.
Financial Statements
# All statements (income, balance, cash flow)
curl "https://api.aisa.one/apis/v1/financial/financial_statements/all?ticker=AAPL" \
-H "Authorization: Bearer $AISA_API_KEY"
Analyst estimate lookups send user research targets to an external provider. In isolation this is ordinary, but in aggregate across portfolio workflows it can reveal investment intentions and should therefore be treated as a valid privacy/security concern.
Analyst Estimates
# EPS forecasts and ratings
curl "https://api.aisa.one/apis/v1/financial/analyst/eps?ticker=AAPL&period=annual" \
-H "Authorization: Bearer $AISA_API_KEY"
Insider trade lookups are sent externally and may be combined with a user's broader watchlist activity. That can expose sensitive due-diligence patterns to the service provider even if the endpoint itself is legitimate.
Insider Trading
# Track insider buy/sell activity
curl "https://api.aisa.one/apis/v1/financial/insider/trades?ticker=AAPL" \
-H "Authorization: Bearer $AISA_API_KEY"
Institutional ownership queries transmit the user's analysis interests to a third party. This is expected for the skill, but remains a real external data-flow risk that should be disclosed and governed by least privilege and informed consent.
Institutional Ownership
# See who owns the stock
curl "https://api.aisa.one/apis/v1/financial/institutional/ownership?ticker=AAPL" \
-H "Authorization: Bearer $AISA_API_KEY"
SEC filing access through the remote API continues the same external transmission pattern. The danger is not the SEC data itself, but the leakage of the user's research agenda and any correlated workflow metadata to the API operator.
SEC Filings
# Access 10-K, 10-Q, 8-K filings
curl "https://api.aisa.one/apis/v1/financial/sec/filings?ticker=AAPL" \
-H "Authorization: Bearer $AISA_API_KEY"
Company news queries send tickers and potentially repeated monitoring activity to an external service. In a portfolio-monitoring use case, this can reveal holdings or targets over time, making the transmission risk more significant than a one-off public lookup.
Company News
curl "https://api.aisa.one/apis/v1/financial/news?ticker=AAPL&limit=10" \
-H "Authorization: Bearer $AISA_API_KEY"
The web search endpoint accepts free-form query strings, so user prompts and research topics may be transmitted verbatim to the provider. This is more sensitive than simple ticker lookups because natural-language queries can contain proprietary strategies, portfolio context, or personal data.
Web Search (News & Articles)
curl -X POST "https://api.aisa.one/apis/v1/scholar/search/web?query=AAPL+stock+analysis&max_num_results=10" \
-H "Authorization: Bearer $AISA_API_KEY"
Academic search also sends free-form research queries off-platform, potentially exposing proprietary analysis themes or sensitive text. Because the endpoint is query-driven, the privacy risk is higher than for fixed-parameter market data lookups.
Academic Research
curl -X POST "https://api.aisa.one/apis/v1/scholar/search/scholar?query=semiconductor+industry+analysis&max_num_results=5" \
-H "Authorization: Bearer $AISA_API_KEY"
Twitter search transmits user-selected symbols and sentiment targets to a third party, potentially revealing speculative interests or active monitoring behavior. Social-sentiment enrichment increases the breadth of external sharing across services, raising cumulative privacy risk.
Twitter Search
curl "https://api.aisa.one/apis/v1/twitter/tweet/advanced_search?query=\$AAPL&queryType=Latest" \
-H "Authorization: Bearer $AISA_API_KEY"
YouTube search sends user interests and query text to an external provider via the API aggregator. Although normal for video discovery, it expands third-party exposure and should be disclosed, especially when combined with other analysis inputs.
YouTube Search (Earnings Calls, Analysis)
curl "https://api.aisa.one/apis/v1/youtube/search?engine=youtube&q=AAPL+earnings+call&gl=us&hl=en" \
-H "Authorization: Bearer $AISA_API_KEY"
The LLM gateway forwards user prompts to external AI models, which can include portfolio holdings, investment theses, or other sensitive text. This is more dangerous than simple data fetches because prompts may be retained, logged, or used by downstream model providers, and the skill markets multi-model routing without a prominent data-sharing warning.
LLM Gateway (OpenAI Compatible)
curl -X POST "https://api.aisa.one/v1/chat/completions" \
-H "Authorization: Bearer $AISA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
- YouTube Content
- Multi-Model LLM Analysis
Base URL: https://api.aisa.one/apis/v1
LLM Base URL: https://api.aisa.one/v1
"""
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
- YouTube Content
- Multi-Model LLM Analysis
Base URL: https://api.aisa.one/apis/v1
LLM Base URL: https://api.aisa.one/v1
"""
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
- YouTube Content
- Multi-Model LLM Analysis
Base URL: https://api.aisa.one/apis/v1
LLM Base URL: https://api.aisa.one/v1
"""
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
- YouTube Content
- Multi-Model LLM Analysis
Base URL: https://api.aisa.one/apis/v1
LLM Base URL: https://api.aisa.one/v1
"""
The YouTube search request forces locale-related parameters to US region and English language via gl="us" and hl="en". This imposes a specific language/locale choice in the skill behavior without offering the user a choice or clearly documenting a justified region-specific constraint.
The manifest describes a market-analysis skill for data, news, sentiment, and portfolio-style workflows, but this implementation also persists full reports to disk by default. Local file output is not an obvious requirement of performing an analysis itself, especially when it happens automatically rather than as a clearly separate export feature.
The output path is derived from user-controlled input (--output) and passed directly to open(..., "w"), allowing arbitrary file overwrite within the executing user's permissions. In an agent or automation context, this can be abused for path traversal or clobbering sensitive local files, which is more dangerous than in a purely interactive CLI utility.
print_report(report)
filename = output_path or f"{ticker}_analysis_{datetime.now().strftime('%Y%m%d')}.json"
with open(filename, "w") as f:
json.dump(report, f, indent=2)
print(f"✅ Full report saved to {filename}")
No suspicious patterns detected.