openclaw - 💡(How to fix) Fix Low-risk: Docker Go template injection, thread-ownership URL path injection, TLS env bypass [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#54300Fetched 2026-04-08 01:29:18
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

Three low-severity findings grouped together:

Error Message

OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 completely disables TLS enforcement for non-loopback WebSocket connections. The error message reveals this bypass mechanism name to anyone who triggers it. Fix: Replace boolean break-glass with narrower mechanisms (e.g., allowlist specific CIDRs). Do not disclose bypass env var names in error messages.

Root Cause

Three low-severity findings grouped together:

Code Example

fetch(`${forwarderUrl}/api/v1/ownership/${channelId}/${threadTs}`, { ... });
RAW_BUFFERClick to expand / collapse

Summary

Three low-severity findings grouped together:

1. Docker Go Template Injection (dist/docker-Bhjg8g2t.js:1008)

readDockerContainerLabel interpolates label parameter into a Go template string passed to docker inspect -f. Currently all callers use hardcoded label strings, but a crafted label like "}}{{...}}{{ could inject Go template directives.

Fix: Validate label names against [a-zA-Z0-9._-]+ pattern.

2. URL Path Injection in thread-ownership (dist/extensions/thread-ownership/index.js:50)

channelId and threadTs from Slack events are interpolated directly into a URL path without encodeURIComponent:

fetch(`${forwarderUrl}/api/v1/ownership/${channelId}/${threadTs}`, { ... });

A crafted channelId = "../../admin" could alter the request path.

Fix: Use encodeURIComponent() for both parameters.

3. TLS Enforcement Bypass via Environment Variable (dist/call-CQbSO4Fr.js:219)

OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1 completely disables TLS enforcement for non-loopback WebSocket connections. The error message reveals this bypass mechanism name to anyone who triggers it.

Additionally, dangerouslyDisableDeviceAuth and dangerouslyAllowHostHeaderOriginFallback config flags bypass device auth and origin checking.

Fix: Replace boolean break-glass with narrower mechanisms (e.g., allowlist specific CIDRs). Do not disclose bypass env var names in error messages.

extent analysis

Fix Plan

To address the three low-severity findings, follow these steps:

1. Docker Go Template Injection

  • Validate label names against the [a-zA-Z0-9._-]+ pattern using a regular expression:
const labelRegex = /^[a-zA-Z0-9._-]+$/;
if (!labelRegex.test(label)) {
  throw new Error(`Invalid label: ${label}`);
}

2. URL Path Injection

  • Use encodeURIComponent() for both channelId and threadTs parameters:
fetch(`${forwarderUrl}/api/v1/ownership/${encodeURIComponent(channelId)}/${encodeURIComponent(threadTs)}`, { ... });

3. TLS Enforcement Bypass

  • Replace the boolean break-glass with narrower mechanisms, such as allowlisting specific CIDRs:
const allowedCidrs = ['192.168.1.0/24', '10.0.0.0/8'];
if (allowedCidrs.some(cidr => ipInRange(ipAddress, cidr))) {
  // Allow the connection
} else {
  // Enforce TLS
}
  • Remove the disclosure of bypass environment variable names in error messages:
// Instead of throwing an error with the env var name
throw new Error('TLS enforcement bypassed');

Verification

Verify that the fixes work by testing the following scenarios:

  • Attempt to inject a crafted label into the Docker Go template and ensure it raises an error.
  • Send a request with a crafted channelId or threadTs and verify that the URL path is correctly encoded.
  • Set the OPENCLAW_ALLOW_INSECURE_PRIVATE_WS environment variable and verify that TLS enforcement is still applied.
  • Test the allowlisting mechanism by connecting from an allowed and a disallowed CIDR.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Low-risk: Docker Go template injection, thread-ownership URL path injection, TLS env bypass [1 participants]