T09 · Insecure Skill Coding Practices
- Location
scripts/http_proxy.py:166- Finding
Unauthenticated HTTP Proxy Exposes Credential-Backed AI Provider Access
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
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.
scripts/http_proxy.py:166Unauthenticated HTTP Proxy Exposes Credential-Backed AI Provider Access
scripts/bootstrap_failover.py:48Predictable Temporary Files Permit Symlink-Based File Overwrites and Metadata Exposure
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.
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
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(),
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.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
- 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
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
providers:
primary-openai:
type: openai-compatible
base_url: https://api.example.com/v1
api_key_env: OPENAI_API_KEY
timeout_ms: 30000
models:
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.
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.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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"}],
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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"}],
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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"}],
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.
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
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.
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
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.
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
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.
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.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
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 calls execute external commands. Without careful input validation, this enables command injection.
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:
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.
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.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
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,
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.
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.
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.
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.
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.