Back to skill

Security audit

API Failover

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent AI failover proxy, but it can expose credential-backed model access through an unauthenticated local HTTP service and broad local discovery, so it needs careful review before use.

Install only if you intend to run a credential-backed local AI routing proxy. Keep it bound to 127.0.0.1 unless you add real authentication and network controls, review every configured upstream provider because prompts may be forwarded there, and avoid running the scripts with elevated privileges until the /tmp file handling and health endpoint exposure are hardened.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/http_proxy.py:166
Finding

Unauthenticated HTTP Proxy Exposes Credential-Backed AI Provider Access

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/bootstrap_failover.py:48
Finding

Predictable Temporary Files Permit Symlink-Based File Overwrites and Metadata Exposure

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (27)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented purpose is failover and routing, but the described behavior extends into environment discovery, reading local configuration, checking environment variables for API keys, scanning localhost ports, and enumerating providers/models. This mismatch is dangerous because it can justify sensitive reconnaissance and configuration harvesting under a benign-sounding reliability skill, leading to credential exposure, infrastructure fingerprinting, or collection of internal system details.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/activate_secondary.py (reported line 46)May include surrounding context.

python
def main():
    env_file_vars = read_env_file(ENV_FILE)
    env = {**env_file_vars, **os.environ}
    report = {
        'env_file': str(ENV_FILE),
        'env_file_exists': ENV_FILE.exists(),

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill advertises and encourages scripts that inspect the environment, generate files, start proxies, and perform health checks, but it declares no explicit tool scope or permission boundaries. In an agent setting, this can lead to over-broad execution of shell, file, network, and environment access without clear user consent or policy enforcement, increasing the risk of unintended data exposure or unsafe actions.

Content

No source excerpt is available for this finding.

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/activation-checklist.md (reported line 12)May include surrounding context.

md
- Service: `systemctl --user status api-failover.service`
- Primary route: `custom-ai-td-ee/gpt-5.4`
- Primary credential inheritance from OpenClaw config: working
- Health check and real curl chat request: working
- Failure responses now return a readable `user_message` and `summary` when all routes fail

### Not yet active

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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/config-example.yaml (reported line 4)May include surrounding context.

yaml
providers:
  primary-openai:
    type: openai-compatible
    base_url: https://api.example.com/v1
    api_key_env: OPENAI_API_KEY
    timeout_ms: 30000
    models:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This configuration explicitly routes prompts and responses to multiple third-party providers and a local model, but the file contains no indication of consent, disclosure, or data-classification controls before off-host transmission. In a failover skill, this is especially relevant because requests may be automatically retried or downgraded to alternate providers, increasing the chance that sensitive data is sent to an unintended external service without operator awareness.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file explains that the layer manages configured providers and later documents remote provider endpoints and request routing, but it does not warn users that their prompts and related request data may be transmitted to third-party services. For a skill description that routes user content across multiple providers, a user-facing privacy/disclosure warning is expected.

Content

No source excerpt is available for this finding.

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/realworld-notes.md (reported line 304)May include surrounding context.

Minimal chat check

bash
curl -s http://127.0.0.1:4010/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "messages": [{"role": "user", "content": "Reply with exactly: ok"}],

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/realworld-notes.md (reported line 316)May include surrounding context.

Minimal chat check

bash
curl -s http://127.0.0.1:4010/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "messages": [{"role": "user", "content": "Reply with exactly: ok"}],

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/realworld-notes.md (reported line 329)May include surrounding context.

Minimal chat check

bash
curl -s http://127.0.0.1:4010/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "messages": [{"role": "user", "content": "Reply with exactly: ok"}],

Unbounded Resource Access

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.

Content

Scanner excerpt · scripts/activate_secondary.py (reported line 16)May include surrounding context.

python
ENV_FILE = Path('/root/.config/api-failover.env')


def can_connect(host, port, timeout=0.5):
    try:
        with socket.create_connection((host, port), timeout=timeout):
            return True

Unbounded Resource Access

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.

Content

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

python
ENV_FILE = Path('/root/.config/api-failover.env')


def can_connect(host, port, timeout=0.5):
    try:
        with socket.create_connection((host, port), timeout=timeout):
            return True

Unbounded Resource Access

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.

Content

Scanner excerpt · scripts/discover_env.py (reported line 19)May include surrounding context.

python
ENV_FILE = Path('/root/.config/api-failover.env')


def can_connect(host, port, timeout=0.5):
    try:
        with socket.create_connection((host, port), timeout=timeout):
            return True

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script loads values from /root/.config/api-failover.env and the process environment, then explicitly checks for ANTHROPIC_API_KEY and OPENROUTER_API_KEY. Although the credentials are not printed, this is sensitive credential access in a code file with no confirmation prompt, user-facing log, or explanatory comment/docstring disclosing that secret-bearing environment variables will be read.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script reloads user systemd state, restarts api-failover.service, and launches another Python script via subprocess. These actions modify runtime system state and execute external commands, but there is no visible confirmation, user-facing log before execution, or explanatory comment/docstring warning the user about these operational side effects.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/activate_secondary.py (reported line 25)May include surrounding context.

python
def run_json(cmd):
    p = subprocess.run(cmd, capture_output=True, text=True)
    if p.returncode != 0:
        return {'ok': False, 'cmd': cmd, 'stdout': p.stdout, 'stderr': p.stderr, 'code': p.returncode}
    try:

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/bootstrap_failover.py (reported line 17)May include surrounding context.

python
def run_json(cmd):
    p = subprocess.run(cmd, capture_output=True, text=True)
    if p.returncode != 0:
        return {'ok': False, 'cmd': cmd, 'stdout': p.stdout, 'stderr': p.stderr, 'code': p.returncode}
    try:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script writes environment discovery results to /tmp using a predictable filename derived from the PID, which may expose potentially sensitive configuration details to other local users or processes. In a failover/bootstrap context, discovery data may include provider endpoints, deployment metadata, or other operational information that should not be broadly readable.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Starting a local HTTP proxy and writing state/log files under /tmp can expose request metadata, operational state, or credentials if those files are readable or replaceable by other local users. In this skill's context, the proxy handles AI/provider failover, so logs and state may contain sensitive routing, health, and API interaction details, making silent creation of these artifacts more dangerous.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/bootstrap_failover.py (reported line 72)May include surrounding context.

python
if args.start_proxy:
        log_path = '/tmp/api-failover-http.log'
        with open(log_path, 'a', encoding='utf-8') as logf:
            proc = subprocess.Popen([
                sys.executable, str(SCRIPTS / 'http_proxy.py'),
                '--config', args.config_out,
                '--host', args.host,

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script inspects a hard-coded local configuration file at /root/.openclaw/openclaw.json and extracts details beyond failover health requirements, including execution security settings, gateway bind/mode, provider inventory, and whether API keys are inline. That broad environment discovery can expose sensitive local topology and security posture to the caller, which is especially risky for an agent skill because it collects unrelated host configuration without clear necessity or consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The main routine silently probes environment variables, local listening services, and local application configuration, then prints a consolidated report without any user-facing warning or confirmation. In a skill context, undisclosed host inspection increases the risk of covert reconnaissance because the user may believe they are only configuring failover logic, not enumerating local services and security-relevant settings.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This script sends request bodies built from the payload file to external provider endpoints via HTTP POST. The file contains no confirmation prompt, print/log disclosure before transmission, or inline warning that user content from the payload will be sent to third-party services.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The unauthenticated /health endpoint returns provider names, available profiles, the on-disk state file path, and full runtime state. In a failover proxy, that state can reveal internal topology, degraded routes, outage history, and filesystem details that help an attacker map the service or target follow-on attacks; the risk is higher because this component is an infrastructure-facing proxy rather than a public content API.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The example user-facing message is presented only in Chinese, which can impose a specific language on users without opt-in. The file does not indicate that this skill is intentionally limited to Chinese-speaking users or provide an alternative language choice.

Content

No source excerpt is available for this finding.