T09 · Insecure Skill Coding Practices
- Location
scripts/stock_data.py:421- Finding
API Key Exposure Through Command-Line Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This appears to be a straightforward Alpha Vantage market-data helper, with minor caution around broad activation phrases and API-key handling.
Install only if you are comfortable sending market-data queries and an Alpha Vantage API key to Alpha Vantage. Prefer setting ALPHA_VANTAGE_KEY over passing --key on the command line, and be aware the broad triggers may cause the skill to be considered for generic stock-market requests.
scripts/stock_data.py:421API Key Exposure Through Command-Line Arguments
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
BASE_URL = "https://www.alphavantage.co/query"
def get_api_key(options):
"""Get API key from options, env, or default."""
return options.get("key") or os.environ.get("ALPHA_VANTAGE_KEY", "demo")
def api_request(params, options=None):
The trigger list is broad and includes generic financial phrases like 'stock market', 'stock price', and 'market data', which can cause the skill to activate for many ordinary finance-related requests. Unintended activation is risky because the skill has Bash permission and may cause external API calls or command execution when a user did not explicitly intend to use this specific skill.
This code file sends command inputs such as stock symbols, search keywords, topics, and tickers to Alpha Vantage over HTTP(S). Although the module docstring names the API, there is no runtime warning, confirmation, or explicit disclosure that user-provided inputs and the API key from the environment may be transmitted to a third-party service.
No suspicious patterns detected.