Back to skill

Security audit

Adversarial Engine

Security checks for vulnerabilities and agentic risk

Overview

This skill matches its stated debate-engine purpose, but it exposes high-risk behavior including unsandboxed model-generated code execution, unauthenticated network endpoints, hard-coded credentials, and under-disclosed local data sharing.

Install only after reviewing and fixing the high-risk defaults: remove and rotate the embedded API key, disable generated-code execution or move it to a real isolated sandbox with per-run approval, bind services to localhost with authentication and rate limits, restrict CORS, prevent cross-user broadcasts, and clearly control what local knowledge-base content is stored or sent to external model providers.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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
Findings (6)

T03 · Remote Payload Retrieval and Execution

Error
Location
engine.py:173
Finding

Externally Generated Python Code Executes Without an Effective Sandbox

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
server.py:112
Finding

Unauthenticated Public Endpoints Can Trigger Model Calls and Code Execution

Content
View full analysis
Remediation
View remediation

other

Error
Location
engine.py:141
Finding

Local Knowledge-Base Content Is Sent to an External Model Provider

Content
View full analysis
= top_k: return results ``` Retrieved content is inserted into the prompt: ```python knowledge_text = "" if knowledge: knowledge_text = "\n\n=== knowledge-base search results ===\n" + "\n".join(knowledge[:2]) ``` The prompt is sent to the external API: ```python payload = { "model": model, "messages": [ {"role": "system", "content": system_prompt}, {"role": "user", "content": user_prompt} ], "max_tokens": 2000, "temperature": 0.7 } resp = requests.post(BASE_URL, headers=headers, json=payload, timeout=90) ``` ### Technical Analysis The engine recursively searches Markdown files under `/home/admin/.openclaw/workspace/kb`, extracts up to 500 characters from matching documents, inserts the excerpts into model prompts, and sends those prompts to `coding.dashscope.aliyuncs.com`. There is no sensitivity classification, redaction, allowlist of approved documents, per-user access control, tenant isolation, outbound-data confirmation, or preview of the exact material being transmitted. Keyword matching is based on attacker-controlled topic terms, allowing a caller to influence which local documents are selected. Vector or knowledge retrieval is part of the declared feature set, but externally disclosing local document contents is not a mini ...[truncated 1075 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
engine.py:37
Finding

Live API Credential Is Hard-Coded in Source Files

Content
View full analysis
str: if HAS_KEY_ROUTER: router = get_key_router() return router.request_key(model) return DEFAULT_API_KEY ``` It is then placed in an authorization header: ```python headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" } ``` ### Technical Analysis A provider API key is embedded directly in two distributed source files and automatically used whenever the local key router cannot be imported. Source code is not a secret store: the credential is exposed to repository readers, artifact recipients, backups, build logs, and any process able to read the Skill files. The fallback also causes the service to continue operating with a shared credential rather than failing securely when credential management is unavailable. Shared keys prevent reliable user attribution and make rotation more difficult. ### Attack Path 1. An attacker obtains the project files through repository access, an artifact, a backup, or local file access. 2. The attacker extracts the hard-coded key. 3. The attacker sends direct requests to the configured provider using the bearer credential. 4. The attacker consumes quota, generates charges, or causes the provider to suspend the account. 5. Activity appears under the shared credential and cannot be reliably attributed to the original caller. ### Impact Assessment The exposed credential may authorize external model usage within the provider account's assigned scope. Consequences include unauthorized charges, quota exhaustion, service disruption, reputational harm, ...[truncated 113 chars]
Remediation
View remediation

other

Error
Location
async_engine.py:383
Finding

Debate Content and Code-Execution Results Are Broadcast Across Users

Content
View full analysis
Remediation
View remediation

T07 · Tool Hijacking and Spoofing

Warning
Location
engine.py:24
Finding

Writable Workspace Directories Are Given Highest Python Import Precedence

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
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (27)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the actual skill runs HTTP/WebSocket services, exposes broadcast interfaces, and uses permissive CORS while presenting itself mainly as a debate engine, users may unknowingly deploy a reachable network service. Open broadcast endpoints and wide CORS materially increase the chance of data leakage, unauthorized cross-origin access, and abuse of the service from untrusted clients.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

If the actual skill runs HTTP/WebSocket services, exposes broadcast interfaces, and uses permissive CORS while presenting itself mainly as a debate engine, users may unknowingly deploy a reachable network service. Open broadcast endpoints and wide CORS materially increase the chance of data leakage, unauthorized cross-origin access, and abuse of the service from untrusted clients.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

If the actual skill runs HTTP/WebSocket services, exposes broadcast interfaces, and uses permissive CORS while presenting itself mainly as a debate engine, users may unknowingly deploy a reachable network service. Open broadcast endpoints and wide CORS materially increase the chance of data leakage, unauthorized cross-origin access, and abuse of the service from untrusted clients.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

If the actual skill runs HTTP/WebSocket services, exposes broadcast interfaces, and uses permissive CORS while presenting itself mainly as a debate engine, users may unknowingly deploy a reachable network service. Open broadcast endpoints and wide CORS materially increase the chance of data leakage, unauthorized cross-origin access, and abuse of the service from untrusted clients.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The class is labeled '代码沙箱' but actually writes code to a temp file and runs it with the system Python interpreter. This misleading abstraction can cause operators to overtrust the safety of the feature, while the implementation provides none of the isolation expected from a real sandbox.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill executes Python code produced by the 'engineer' model as part of normal debate flow, despite the manifest describing a debate/review engine rather than a trusted code runner. This gives externally influenced model output a direct path to code execution, dramatically increasing risk because prompt injection or adversarial topics can steer the model to emit harmful code.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The engine automatically extracts and executes code from model output when enable_code_sandbox is true, without a user-facing warning or confirmation gate. In this skill's context, where the system orchestrates adversarial multi-model interactions, unreviewed execution is especially dangerous because one model can induce another to generate payloads that run locally.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

A hardcoded API key is embedded directly in source code. This can lead to credential leakage through source control, logs, backups, or unauthorized reuse, potentially allowing third parties to consume paid API resources or access associated account capabilities.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The class and comments describe 'safe execution', but the implementation simply writes untrusted Python to a temp file and runs it as a normal subprocess. This is especially dangerous because the misleading safety claim can cause operators to trust hostile code paths and enable the feature in production.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill's purpose is multi-model debate and design review, yet it adds local execution of model-generated Python, which materially expands the attack surface without being necessary for the core function. In this context, prompt injection or malicious content in debate history can pivot directly into code execution on the host.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
92% confidence
Finding

The sandbox writes arbitrary generated Python to a temporary file and executes it via subprocess. Although there are internal comments and runtime status prints, there is no explicit warning to the user that untrusted model-produced code may be executed on the system when sandboxing is enabled.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises code execution, WebSocket/network behavior, and likely file access capabilities, but it declares no explicit tool scope or permissions. This creates a least-privilege failure: reviewers and users cannot tell what the skill is allowed to do, and a runtime may grant broader access than intended.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill description mentions Python sandbox execution and WebSocket pushing but provides no warning about code execution risk or outbound/real-time data transmission. Users may supply sensitive inputs or enable the feature without understanding that generated code may run and that debate content may be transmitted to connected clients.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The execution flow states that conclusions are saved and solidified into a knowledge base, but there is no warning about retention, persistence scope, or what content is stored. In a multi-model debate system, stored conclusions may include user prompts, internal analysis, code, and potentially sensitive business or security information, making silent retention a meaningful privacy and security risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

A default API key is hardcoded in source, which risks credential leakage through source control, logs, backups, or reuse in other environments. Anyone obtaining the code may be able to abuse the key for unauthorized API usage, incur cost, or access associated account capabilities.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
98% confidence
Finding

The code invokes subprocess.run on a temporary Python file whose contents come from LLM-generated output. Because the 'sandbox' does not restrict filesystem, network, process creation, or Python imports, this is effectively local execution of untrusted code and can lead to arbitrary code execution, data theft, or host compromise.

Content

Scanner excerpt · async_engine.py (reported line 112)May include surrounding context.

python
temp_path = f.name
        
        try:
            result = subprocess.run(
                ['python3', temp_path],
                capture_output=True,
                text=True,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill sends the user topic and accumulated debate history to an external LLM endpoint, but the code shows no clear disclosure, consent flow, or data minimization controls. This can expose sensitive user inputs, generated code, and internal reasoning context to third-party services, creating privacy and confidentiality risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The system prompt explicitly instructs the model to reply in Chinese, imposing a language choice regardless of user preference. This is a natural-language policy issue because no opt-in or user-selectable locale is offered.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
98% confidence
Finding

The code launches Python on model-generated content via subprocess.run without any real sandboxing beyond a timeout and /tmp working directory. An attacker who can influence the model output or debate topic can cause arbitrary local code execution, including file access, network calls, or process spawning with the privileges of the running service.

Content

Scanner excerpt · engine.py (reported line 183)May include surrounding context.

python
temp_path = f.name
        
        try:
            result = subprocess.run(
                ['python3', temp_path],
                capture_output=True,
                text=True,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This function sends system and user prompts to a remote LLM endpoint over HTTP, which may transmit user-provided topics and generated content off-box. The code does not provide a clear user warning or documentation disclosure that debate inputs are sent to an external service.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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 · engine.py (reported line 248)May include surrounding context.

python
}
    
    try:
        resp = requests.post(BASE_URL, headers=headers, json=payload, timeout=90)
        
        if resp.status_code != 200:
            release_api_key(model, rate_limit_hit=(resp.status_code == 429))

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The system prompt explicitly instructs the models to always reply in Chinese. This is a language policy constraint imposed by the skill without offering the user a language choice or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file-level description, authoring text, and subsequent user-facing strings are all written exclusively in Chinese, indicating the skill is designed to communicate in a single language. The policy requires either user opt-in for a forced language/locale or a clearly documented justification for the restriction, which is not present here.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file exposes a network-accessible FastAPI server bound to 0.0.0.0 with permissive CORS, open HTTP routes, and an unauthenticated WebSocket endpoint that can trigger background debate tasks. In the context of a local skill, this materially expands the attack surface beyond a narrowly scoped internal helper and could allow any reachable client to invoke compute-intensive operations or interact with connected clients.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

模块头部 L004 宣称集成“WebSocket”,但代码中仅有全局 ws_clients 列表和一个 broadcast_ws 方法(L442-L449),没有连接建立、认证、注册、生命周期管理或服务端入口。该实现与描述的集成能力相比明显更弱,更像未完成的辅助接口。

Content

No source excerpt is available for this finding.