Back to skill

Security audit

Economic Calendar Fetcher Zc

Security checks for vulnerabilities and agentic risk

Overview

The skill coherently fetches economic-calendar data from the declared FMP API, with the main caution being how users provide and protect their FMP API key.

Install only if you are comfortable using an FMP API key for this purpose. Prefer setting FMP_API_KEY through your environment or a secret manager, avoid pasting real keys into chat or command examples, rotate any key that was exposed in logs, and specify an explicit output path when saving reports.

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

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:58
Finding

Insecure API Key Submission and Exposure Through Chat and Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:58-74, SKILL.md:98-108, scripts/get_economic_calendar.py:207-210
Vulnerability Type: Sensitive credential exposure through persistent communication and process channels
Risk Level: Medium

Vulnerable Code and Instructions

SKILL.md:58-74 directs the agent to request an API key through chat when the environment variable is unavailable:

markdown
### Step 1: Obtain FMP API Key

**Check for API key availability:**

1. First check if FMP_API_KEY environment variable is set
2. If not available, ask user to provide API key via chat
3. If user doesn't have API key, provide instructions:
   - Visit https://financialmodelingprep.com
   - Sign up for free account (250 requests/day limit)
   - Navigate to API dashboard to obtain key

**Example user interaction:**

User: "Show me economic events for next week" Assistant: "I'll fetch the economic calendar. Do you have an FMP API key? I can use the FMP_API_KEY environment variable, or you can provide your API key now."

text

SKILL.md:98-108 recommends supplying the secret as a command-line argument:

markdown
**Basic usage (default 7 days):**
```bash
python3 /path/to/economic-calendar-fetcher/scripts/get_economic_calendar.py --api-key YOUR_KEY

With specific date range:

bash
python3 /path/to/economic-calendar-fetcher/scripts/get_economic_calendar.py \
  --from 2025-01-01 \
  --to 2025-01-31 \
  --api-key YOUR_KEY \
  --format json
text

The script implements the documented command-line credential channel at `scripts/get_economic_calendar.py:207-210`:

```python
parser.add_argument(
    '--api-key', dest='api_key',
    help='FMP API key (overrides FMP_API_KEY environment variable)'
)

Technical Analysis

API keys are bearer credentials and must not be submitted through channels that are commonly retained or observable. Asking users to paste an FMP key into chat can place the credential in conversation transcripts, tele ...[truncated 2326 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the instruction to request API keys through chat. Explicitly warn users never to paste credentials into conversations.
  2. Remove or deprecate the --api-key argument so secrets cannot be exposed through process arguments or shell history.
  3. Require FMP_API_KEY to be supplied through a protected environment-injection mechanism or platform secret manager.
  4. Where interactive local execution is necessary, accept the key through a non-echoing prompt using getpass.getpass() rather than through command-line arguments.
  5. Update usage examples to show only secret-safe invocation:
bash
FMP_API_KEY="$(secure-secret-tool read fmp-api-key)" \
python3 scripts/get_economic_calendar.py \
  --from 2025-01-01 \
  --to 2025-01-31
  1. Never print the API key or a complete authenticated request URL. Sanitize exception messages, telemetry, proxy logs, and debug output so the apikey query value is replaced with [REDACTED].
  2. Add documentation directing users to rotate the FMP key immediately if it has previously been pasted into chat, entered as a command-line argument, or included in logs.
  3. Apply least privilege at the FMP account level where supported, including restricted API products, rate limits, usage alerts, and periodic key rotation.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Tainted flow: 'url' from os.environ.get (line 61, credential/environment) → urllib.request.urlopen (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 · scripts/get_economic_calendar.py (reported line 65)May include surrounding context.

python
try:
        # Make API request
        with urllib.request.urlopen(url) as response:
            if response.status != 200:
                raise ValueError(f"API returned status code {response.status}")

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The instruction "All reports in English" imposes a fixed language choice. Under the policy, forcing a specific language without offering user choice or documenting a justified locale constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill explicitly instructs saving generated reports to disk and defines filename conventions, but it does not warn about local file creation, possible overwrites, or where files will be written. In agent contexts, silent persistence can surprise users, leak sensitive data into shared workspaces, or overwrite existing files if names collide.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This is a markdown file, so SQP-2 applies to omissions in the skill description. The documentation includes curl and Python examples that send the API key as a query parameter, but it does not warn users that query-string credentials may be exposed in shell history, logs, proxies, or monitoring systems.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.