Back to skill

Security audit

Sectors Financial Agents

Security checks for vulnerabilities and agentic risk

Overview

This skill coherently connects to the Sectors market-data API using a user-provided API key, with no hidden destructive behavior found.

Install only if you trust the Sectors API provider and are comfortable giving the agent access to SECTORS_API_KEY for market-data queries. Prefer a protected secret store or session-scoped environment variable over putting the key in shell history, .bashrc, or repository .env files, and consider installing requests in an isolated environment with pinned versions.

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
SKILL.md:52
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:37
Finding

API Key Exposed Through Plaintext Persistence and Command Arguments

Content
View full analysis
> ~/.bashrc # Option C: Use a .env file in the project root (see .env.example) ``` For agent-specific configuration: - **Claude Code**: `claude config set env SECTORS_API_KEY your-api-key-here` - **OpenCode**: Set in `~/.config/opencode/config.json` under `env` - **Cursor**: Settings > Features > Environment Variables ``` ### Technical Analysis The instructions encourage storing the API key in plaintext shell profiles and agent configuration files. These files may be readable by other local processes, included in workstation backups, collected in diagnostic archives, or accidentally copied and shared. The `echo` and `claude config set` examples also place the credential directly in an interactive command. Depending on the shell and operating system, the key may be retained in shell history or temporarily exposed through process command-line inspection. The `.env` option does not include guidance on restrictive file permissions, source-control exclusion, or secret rotation. The referenced `.env.example` is also absent from the audited project, increasing the chance that users will create an incorrectly protected file. The API key's transmission in the `Authorization` header to `https://api.sectors.app/v1` is necessary for the declared functionality and is not itself unauthorized exfiltration. The identified weakness concerns local storage and handling of that credential. ### Attack Path 1. A user replaces `your-api-key-here` with a real Sectors API key and runs one of the documented commands. 2. The key is stored in shell history, a plaintext shell ...[truncated 859 chars]
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
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (18)

Tainted flow: 'headers' from os.environ.get (line 50, 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 · scripts/check_setup.py (reported line 53)May include surrounding context.

python
headers = {"Authorization": api_key}

    try:
        resp = requests.get(url, headers=headers, timeout=15)
    except requests.exceptions.ConnectionError:
        print(f"[!!] Cannot reach {BASE_URL}. Check your network connection.")
        sys.exit(3)

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

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

user to set it: export SECTORS_API_KEY="your-api-key-here" or run the setup check script at scripts/check_setup.py.

Setup

1. Set the API key

The API key must be available as the SECTORS_API_KEY environment variable.

bash
# Option A: Set in your current shell
export SECTORS_API_KEY="your-api-key-here"

# Option B: Add to your shell profile (~/.bashrc, ~/.zshrc) for persistence
echo 'export SECTORS_API_KEY="your-api-key-here"' >> ~/.bashrc

# Option C: Use a .env file in the project root (see .env.example)

For agent-specific configuration:

  • Claude Code: claude config set env SECTORS_API_KEY your-api-key-here
  • OpenCode: Set in ~/.config/opencode/config.json under env
  • Cursor: Settings > Features > Environment Variables

2. Install the dependency

bash
pip install requests

3. Verify setup (optional)

bash
python scripts/check_setup.py

Making requests

python
import os
import requests

API_KEY = os.environ["SECTOR

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

Option B: Add to your shell profile (~/.bashrc, ~/.zshrc) for persistence

echo 'export SECTORS_API_KEY="your-api-key-here"' >> ~/.bashrc

Option C: Use a .env file in the project root (see .env.example)

text

For agent-specific configuration:

Lp1

High
Category
MCP Least Privilege
Confidence
88% confidence
Finding

This skill performs network access to an external API, but that capability is reportedly not covered by declared permissions. In permissioned agent environments, undeclared network behavior is a real governance and security issue even when the destination is legitimate, because it bypasses least-privilege expectations.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
88% confidence
Finding

This skill performs network access to an external API, but that capability is reportedly not covered by declared permissions. In permissioned agent environments, undeclared network behavior is a real governance and security issue even when the destination is legitimate, because it bypasses least-privilege expectations.

Content

No source excerpt is available for this finding.

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · scripts/check_setup.py (reported line 31)May include surrounding context.

python
_VAR = "SECTORS_API_KEY"
BASE_URL = "https://api.sectors.app/v1"
TEST_ENDPOINT = "/subsectors/"


def main():
    # 1. Check environment variable
    api_key = os.environ.get(ENV_VAR)
    if not api_key:
        print(f"ERROR: {ENV_VAR} environment variable is not set.")
        print()
        print("Set it with one of:")
        print(f'  export {ENV_VAR}="your-api-key-here"')
        print(f'  echo \'export {ENV_VAR}="your-api-key-here"\' >> ~/.bashrc')
        print()
        print("Get your API key at: https://sectors.app/api")
        sys.exit(1)

    print(f"[ok] {ENV_VAR} is set ({len(api_key)} characters)")

    # 2. Check requests is installed
    try:
        import requests
    except ImportError:
        print("[!!] 'requests' library is not installed.")
        print("     Install it with: pip install requests")
        sys.exit(3)

    print("[ok] requests library is available")

    # 3. Test API connectivity
    url = f"{BASE_URL}{TEST_ENDPOINT}"
    headers = {"Author

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

md
import sys

ENV_VAR = "SECTORS_API_KEY"
BASE_URL = "https://api.sectors.app/v1"
TEST_ENDPOINT = "/subsectors/"

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

md
import sys

ENV_VAR = "SECTORS_API_KEY"
BASE_URL = "https://api.sectors.app/v1"
TEST_ENDPOINT = "/subsectors/"

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

md
import sys

ENV_VAR = "SECTORS_API_KEY"
BASE_URL = "https://api.sectors.app/v1"
TEST_ENDPOINT = "/subsectors/"

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

md
import sys

ENV_VAR = "SECTORS_API_KEY"
BASE_URL = "https://api.sectors.app/v1"
TEST_ENDPOINT = "/subsectors/"

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

md
import sys

ENV_VAR = "SECTORS_API_KEY"
BASE_URL = "https://api.sectors.app/v1"
TEST_ENDPOINT = "/subsectors/"

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

md
import sys

ENV_VAR = "SECTORS_API_KEY"
BASE_URL = "https://api.sectors.app/v1"
TEST_ENDPOINT = "/subsectors/"

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

md
import sys

ENV_VAR = "SECTORS_API_KEY"
BASE_URL = "https://api.sectors.app/v1"
TEST_ENDPOINT = "/subsectors/"

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 · references/idx-endpoints.md (reported line 3)May include surrounding context.

md
import sys

ENV_VAR = "SECTORS_API_KEY"
BASE_URL = "https://api.sectors.app/v1"
TEST_ENDPOINT = "/subsectors/"

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 · references/sgx-endpoints.md (reported line 3)May include surrounding context.

md
import sys

ENV_VAR = "SECTORS_API_KEY"
BASE_URL = "https://api.sectors.app/v1"
TEST_ENDPOINT = "/subsectors/"

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/check_setup.py (reported line 19)May include surrounding context.

python
import sys

ENV_VAR = "SECTORS_API_KEY"
BASE_URL = "https://api.sectors.app/v1"
TEST_ENDPOINT = "/subsectors/"

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This is a markdown file, so missing-warning checks apply to documented behaviors affecting privacy or system integrity. The file states that requests require an Authorization: <api_key> header but provides no caution about protecting the API key, which could lead users to embed or expose credentials insecurely when following the reference.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file documents requests to an external API and explicitly requires an Authorization header containing an API key. Under the markdown-specific warning rule, the description lacks any caution about credential handling, external transmission, or protecting the key from logs and sharing.

Content

No source excerpt is available for this finding.