Back to skill

Security audit

skill-to-http-flash

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent about turning a skill into an HTTP API, but its generated server can expose skill execution and async results too broadly by default.

Review before installing or deploying. Use this only for skills you are comfortable exposing as an API. Bind generated servers to localhost unless you intentionally need network access, set FLASH_API_KEY, restrict CORS, enable HTTPS for cross-host calls, and avoid async mode for sensitive or very large outputs unless job history is protected.

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
assets/server_template.py:1025
Finding

Unauthenticated Network-Wide Exposure of Skill Execution Endpoints

Content
View full analysis
None: if not FLASH_API_KEY: return key = request.headers.get(API_KEY_HEADER_NAME, "").strip() # Constant-time comparison if not hmac.compare_digest(key, FLASH_API_KEY): raise HTTPException( status_code=401, detail="Unauthorized: invalid or missing API key", ) ``` ```python @app.post("/run") async def run_sync(req: RunRequest, request: _Request): """Synchronous execution through subprocess.run.""" _check_api_key(request) params = _extract_params(req) start = time.time() try: _validate_input(params) except FlashError as e: elapsed = int((time.time() - start) * 1000) logger.warning(f"validation_failed: {e.message}") return _envelope_error(e.error_type, e.message, elapsed, http_status=400) try: argv = _build_argv(params) except FlashError as e: elapsed = int((time.time() - start) * 1000) logger.warning(f"{e.error_type}: {e.message}") return _envelope_error( e.error_type, e.message, elapsed, http_status=500 if e.error_type == "entry_not_found" else 400, ) try: proc, stdout_truncated, stderr_truncated = _run_subprocess( argv, req.timeout_seconds, truncate=True, ...[truncated 2822 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
assets/server_template.py:1000
Finding

Asynchronous Job Results Bypass Configured API-Key Authentication

Content
View full analysis
str: job_id = uuid.uuid4().hex[:12] job = { "job_id": job_id, "skill": skill_name, "status": "pending", "params": params, "created_at": time.time(), "result": None, "error": None, "elapsed_ms": None, } with self._lock: self._jobs[job_id] = job return job_id ``` ```python def _append_jsonl(self, job: dict) -> None: with self._file_lock: try: if JOBS_FILE.exists() and JOBS_FILE.stat().st_size >= JOBS_FILE_MAX_BYTES: self._rotate_jsonl() line = json.dumps(job, ensure_ascii=False, default=str) with JOBS_FILE.open("a", encoding="utf-8") as f: f.write(line + "\n") except Exception as e: logger.warning(f"JSONL persist failed for {job.get('job_id')}: {e}") ``` The asynchronous submission endpoint checks the API key: ```python @app.post("/run/async") async def run_async(req: RunRequest, request: _Request): """Asynchronous execution with untruncated output.""" _check_api_key(request) params = _extract_params(req) ``` The corresponding retrieval endpoint does not: ```python @app.get("/jobs/{job_id}") async def get_job(job_id: str): job = job_store.get(job_id) if not job: raise HTTPException(status_code=404, detail="Job not found or expired (1-hour memory TTL)") return job ``` ### Technical Analysis API-key validation is performed when an asynchronous job is submitted, but the endpoint used to retrieve that job does not accept the request object and never calls `_ch ...[truncated 2444 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (50)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
| `{"tags": ["a","b"]}` | `--tags a --tags b`(重复 flag)|
| `{"meta": {"k":"v"}}` | `--meta '{"k":"v"}'`(嵌套对象序列化为 JSON 字符串)|

**安全**:字段名走白名单 `[a-z][a-z0-9_]*`(防 `--foo;rm -rf /`),argv 走 list 不拼 shell。

---

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
| `{"tags": ["a","b"]}` | `--tags a --tags b`(重复 flag)|
| `{"meta": {"k":"v"}}` | `--meta '{"k":"v"}'`(嵌套对象序列化为 JSON 字符串)|

**安全**:字段名走白名单 `[a-z][a-z0-9_]*`(防 `--foo;rm -rf /`),argv 走 list 不拼 shell。

---

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
| `{"tags": ["a","b"]}` | `--tags a --tags b`(重复 flag)|
| `{"meta": {"k":"v"}}` | `--meta '{"k":"v"}'`(嵌套对象序列化为 JSON 字符串)|

**安全**:字段名走白名单 `[a-z][a-z0-9_]*`(防 `--foo;rm -rf /`),argv 走 list 不拼 shell。

---

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
| `{"tags": ["a","b"]}` | `--tags a --tags b`(重复 flag)|
| `{"meta": {"k":"v"}}` | `--meta '{"k":"v"}'`(嵌套对象序列化为 JSON 字符串)|

**安全**:字段名走白名单 `[a-z][a-z0-9_]*`(防 `--foo;rm -rf /`),argv 走 list 不拼 shell。

---

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
| `{"tags": ["a","b"]}` | `--tags a --tags b`(重复 flag)|
| `{"meta": {"k":"v"}}` | `--meta '{"k":"v"}'`(嵌套对象序列化为 JSON 字符串)|

**安全**:字段名走白名单 `[a-z][a-z0-9_]*`(防 `--foo;rm -rf /`),argv 走 list 不拼 shell。

---

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

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

md
| `{"tags": ["a","b"]}` | `--tags a --tags b`(重复 flag)|
| `{"meta": {"k":"v"}}` | `--meta '{"k":"v"}'`(嵌套对象序列化为 JSON 字符串)|

**安全**:字段名走白名单 `[a-z][a-z0-9_]*`(防 `--foo;rm -rf /`),argv 走 list 不拼 shell。

---

Unbounded Output

Medium
Category
Output Handling
Confidence
89% confidence
Finding

The README explicitly advertises /run/async as having 'no truncation', which implies potentially unbounded capture and persistence of subprocess output. In the context of a service that wraps arbitrary skills and stores async results in memory plus JSONL persistence, an attacker or even a buggy skill could emit excessive output and drive memory, disk, or log growth, leading to denial of service.

Content

Scanner excerpt · README.md (reported line 29)May include surrounding context.

md
- **Subprocess direct execution** — no LLM drift, 100% reproducible, `<2s` cold start
- **JSON → CLI mapping** — request JSON auto-maps to long flags (`{"foo_bar": 10}` → `--foo-bar 10`), field-name allowlist `[a-z][a-z0-9_]*` + argv-as-list (no shell injection)
- **Unified envelope** — business failure (`exit_code != 0`) returns HTTP 200 + `success:false`; only framework errors use HTTP status codes
- **Sync + async** — `POST /run` (60s default, 512KB truncation) and `POST /run/async` (no truncation, in-memory + JSONL persistence, logrotate, SQLite export)
- **Multi-agent runtime** — auto-detects skill dirs for OpenClaw / Claude Code / Cursor / generic `./skills` out of the box, or override via `FLASH_SKILL_DIR` / `--skill-dir`
- **HTTP by default, HTTPS on demand** — self-signed SAN cert auto-generation, optional API-Key auth (`hmac.compare_digest` constant-time), configurable CORS
- **Self-contained output** — generated `server.py` has cert / job store / argv builder / envelope inlined; `scp` it to any machine and run

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

python3 server.py start

3. Call it

curl -X POST http://127.0.0.1:7780/run
-H 'content-type: application/json'
-d '{"foo": "bar"}'

text

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 109)May include surrounding context.

python3 server.py start

3. Call it

curl -X POST http://127.0.0.1:7780/run
-H 'content-type: application/json'
-d '{"foo": "bar"}'

text

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/standalone-usage.md (reported line 60)May include surrounding context.

python3 server.py start

3. Call it

curl -X POST http://127.0.0.1:7780/run
-H 'content-type: application/json'
-d '{"foo": "bar"}'

text

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill describes broad capabilities including filesystem access, environment-variable use, networking, and shell/subprocess execution, but it does not declare any tool scope such as permissions or allowed-tools. That gap makes it easier for an agent platform to invoke the skill with more privilege than intended and harder for operators to review or sandbox its behavior safely.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The activation phrases are broad and overlap with ordinary user requests about exposing services, starting APIs, or structuring input/output. This increases the chance the skill is invoked unintentionally in contexts where creating an HTTP microservice or exposing a local script was not the user's explicit security-reviewed intent.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
cd ~/.openclaw/workspace/skills/skill-to-http-flash/scripts

# 1. 创建 flash 项目
python3 flash.py create --skill <skill-name>
#   → 解析入口、提参数 schema、交互确认端口/超时/TLS
#   → 生成到 <workspace>/.skill-to-http-flash/services/<skill-name>-api/

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 226)May include surrounding context.

bash
# 提交
JOB=$(curl -s -X POST http://127.0.0.1:7780/run/async \
  -H 'content-type: application/json' -d '{"big_query": true}')
JOB_ID=$(echo "$JOB" | jq -r .job_id)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation states that authentication is optional and CORS defaults to *, while also describing easy HTTP exposure of generated services. Even if intended for local use, these insecure defaults materially increase the risk of accidental unauthenticated access, browser-origin abuse, or unsafe deployment to broader networks.

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

echo -n "mysecret" > <HTTP_ROOT>/secrets/api-keys/flash-.key # 文件(0600)

调用

curl -H 'X-API-Key: mysecret' http://...:7780/run -d '{...}'

text

未设置不做认证(仅适合内网受信测试)。公网部署请走前置反代 + 公认证书。

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
## 参考文档

- `references/migration-from-v1.md` — v1 用户如何 recreate
- `references/standalone-usage.md` — 非 OpenClaw 环境完整使用指南

---

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
## 参考文档

- `references/migration-from-v1.md` — v1 用户如何 recreate
- `references/standalone-usage.md` — 非 OpenClaw 环境完整使用指南

---

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This Python file includes prominent natural-language strings in Chinese, such as the module banner and operational descriptions, without any indication that the skill is intentionally region-specific or that users can opt into another language. Under the policy rule, forcing a specific language in user-facing text is a natural-language policy violation when no choice or justification is provided.

Content

No source excerpt is available for this finding.

Unbounded Output

Medium
Category
Output Handling
Confidence
90% confidence
Finding

The async execution path explicitly disables output truncation and stores full results in memory and JSONL persistence. A caller can invoke a skill that emits extremely large stdout/stderr, causing memory growth, disk consumption, and degraded availability; this is more dangerous here because the wrapper intentionally exposes arbitrary skill execution over HTTP and defaults to listening on all interfaces.

Content

Scanner excerpt · assets/server_template.py (reported line 757)May include surrounding context.

python
<tr><td><code>GET /health</code></td><td>Health check</td></tr>
<tr><td><code>GET /schema</code></td><td>Input parameter schema</td></tr>
<tr><td><code>POST /run</code></td><td>Execute skill (sync, 60s default)</td></tr>
<tr><td><code>POST /run/async</code></td><td>Execute skill (async, no truncation)</td></tr>
<tr><td><code>GET /jobs/&lcub;job_id&rcub;</code></td><td>Poll async job</td></tr>
</table></div>
<div class="card"><h3>Sync</h3>

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · assets/server_template.py (reported line 761)May include surrounding context.

python
<tr><td><code>GET /jobs/&lcub;job_id&rcub;</code></td><td>Poll async job</td></tr>
</table></div>
<div class="card"><h3>Sync</h3>
<pre>curl -X POST {schema}://{lan_ip}:{PORT}/run \\
  -H "Content-Type: application/json" \\
  -d '{json.dumps(_example_payload(), indent=2, ensure_ascii=False)}'</pre></div>
<p style="color:#888;font-size:12px;">Generated {GENERATED_AT} | <a href="/docs">Swagger UI</a></p>

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest frames this skill as compiling a single skill into a standalone HTTP REST microservice that executes the skill via subprocess. In addition to serving HTTP, the code implements local lifecycle control features (status and especially stop) that inspect arbitrary PIDs from a file and send termination signals, which is a separate process-management capability not clearly justified by the stated purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The startup warning and several adjacent operational messages are presented in Chinese only, which imposes a fixed language on users of the generated server interface. There is no visible mechanism for selecting locale or any documentation justifying the language restriction.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · references/migration-from-v1.md (reported line 34)May include surrounding context.

通过 hub 重装(或 git pull)

openclaw skills install skill-to-http-flash

确认 version

grep ^version: ~/.openclaw/workspace/skills/skill-to-http-flash/SKILL.md

→ version: 2.0.0

text

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/migration-from-v1.md (reported line 55)May include surrounding context.

没加也可以——v2.0 会启发式扫 scripts/<name>.py / cli.py / main.py / run.py。但加上更稳。

3. recreate 所有 v1 project

bash
# 列出现有 project