Back to skill

Security audit

Azure OpenAI Proxy

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed local Azure OpenAI proxy for OpenClaw, with some setup and availability cautions but no artifact-backed deception or exfiltration behavior.

Install only if you intend to route OpenClaw traffic through Azure OpenAI. Keep the proxy bound to localhost unless you add separate access controls, treat the Azure API key in OpenClaw config as sensitive, and do not enable the optional systemd service unless you have reviewed or created the service file yourself.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/server.js:52
Finding

Unbounded Request-Body Buffering Enables Denial of Service

Content
View full analysis

Vulnerability Details

File Location: scripts/server.js, lines 52–55
Vulnerability Type: Unbounded memory allocation during HTTP request processing
Risk Level: Medium

javascript
let body = '';
req.on('data', chunk => { body += chunk; });

req.on('end', () => {

Technical Analysis

The proxy accumulates every incoming request-body chunk in the body string without enforcing a maximum byte count. It also does not establish a request timeout or reject oversized requests based on Content-Length.

Consequently, a connected client can cause the Node.js process to retain an arbitrarily large body in memory before the request is forwarded to Azure. Repeated string concatenation may also increase allocation and copying overhead. Although the default listener is restricted to 127.0.0.1, the AZURE_PROXY_BIND configuration allows operators to expose the service to other hosts, increasing exploitability.

Attack Path

  1. The attacker obtains network access to the configured proxy listener. This may be local access under the default configuration or remote access if AZURE_PROXY_BIND exposes the service.
  2. The attacker opens one or more connections and sends a POST request whose URL contains /chat/completions.
  3. The attacker transmits a very large body, or transmits body data slowly while keeping the connection open.
  4. The data handler continuously appends received chunks to body without applying a size limit.
  5. Process memory consumption and allocation overhead increase until the event loop becomes degraded or the Node.js process is terminated due to memory exhaustion.

Impact Assessment

Successful exploitation does not grant additional operating-system privileges or access to Azure credentials. Its primary effect is loss of availability within the proxy process and its service scope. Potential consequences include excessive memory and CPU consumption, delayed legitimate model re ...[truncated 105 chars]

Remediation
View remediation

Remediation Suggestions

  • Track received bytes and enforce a conservative request-body limit appropriate for expected OpenAI requests.
  • Return HTTP 413 Payload Too Large and destroy the request as soon as the limit is exceeded.
  • Validate Content-Length when present, while retaining streaming byte-count enforcement because that header may be absent or dishonest.
  • Configure request, header, keep-alive, and socket timeouts to reduce slow-request attacks.
  • Limit concurrent connections and apply rate limiting when the listener is accessible beyond a trusted local host.
  • Keep the default loopback binding and require an authenticated, access-controlled reverse proxy if remote exposure is necessary.
  • Where practical, forward requests using bounded streaming rather than retaining the entire body in memory.
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/server.js

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

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

Copy the template and configure:

bash
mkdir -p ~/.config/systemd/user
cp scripts/azure-proxy.service ~/.config/systemd/user/

# Edit the service file with your Azure details

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% 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 101)May include surrounding context.

Enable and start

systemctl --user daemon-reload systemctl --user enable azure-proxy systemctl --user start azure-proxy

text

Static analysis

No suspicious patterns detected.