openclaw - ✅(Solved) Fix Image generation blocked in TUN/fake-ip proxy environments (SSRF check too strict) [1 pull requests, 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#63251Fetched 2026-04-09 07:56:17
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
cross-referenced ×1referenced ×1

Root Cause

This is because resolveAndValidateIP() does DNS resolution and rejects IPs in the 198.18.0.0/15 range. TUN mode proxies hijack all DNS to fake IPs in this range.

Fix Action

Fixed

PR fix notes

PR #63255: feat: support dangerouslyAllowPrivateNetwork for media generation providers

Description (problem / solution / changelog)

Summary

When using TUN/fake-ip proxy mode (e.g. Clash TUN, Surge TUN), DNS resolves all hostnames to private IPs (e.g. 198.18.0.0/15). OpenClaw's SSRF protection blocks these requests, causing image/music/video generation to fail with:

Blocked: resolves to private/internal/special-use IP address

This PR adds an opt-in escape hatch, following the same pattern already used by the Telegram channel's network.dangerouslyAllowPrivateNetwork option.

Changes

  1. New config option: agents.defaults.network.dangerouslyAllowPrivateNetwork: true
  2. New env var: OPENCLAW_ALLOW_PRIVATE_NETWORK=1
  3. When enabled, SSRF IP validation is skipped for media generation providers:
    • minimax (image, video, music)
    • openai (image, video)
    • fal (image, video)
    • vydra (shared, speech)
    • together (video)
    • byteplus (video)
    • xai (video)

Usage

# openclaw.json
{
  "agents": {
    "defaults": {
      "network": {
        "dangerouslyAllowPrivateNetwork": true
      }
    }
  }
}

Or via environment variable:

OPENCLAW_ALLOW_PRIVATE_NETWORK=1 openclaw gateway start

Security Note

This is intentionally named dangerously to signal the security trade-off. It should only be enabled in trusted environments where the proxy is under user control.

Closes #63251

Changed files

  • extensions/byteplus/video-generation-provider.ts (modified, +7/-1)
  • extensions/fal/image-generation-provider.ts (modified, +7/-1)
  • extensions/fal/video-generation-provider.ts (modified, +7/-1)
  • extensions/minimax/image-generation-provider.ts (modified, +15/-1)
  • extensions/minimax/music-generation-provider.ts (modified, +10/-1)
  • extensions/minimax/video-generation-provider.ts (modified, +10/-1)
  • extensions/openai/image-generation-provider.ts (modified, +2/-0)
  • extensions/openai/video-generation-provider.ts (modified, +7/-1)
  • extensions/together/video-generation-provider.ts (modified, +7/-1)
  • extensions/vydra/shared.ts (modified, +1/-1)
  • extensions/vydra/speech-provider.ts (modified, +1/-1)
  • extensions/xai/video-generation-provider.ts (modified, +7/-1)
  • src/config/types.agent-defaults.ts (modified, +8/-0)
  • src/config/zod-schema.agent-defaults.ts (modified, +11/-0)

Code Example

Blocked: resolves to private/internal/special-use IP address
RAW_BUFFERClick to expand / collapse

Problem

When using a VPN/proxy with TUN (virtual NIC) mode or fake-ip DNS, the image generation tool blocks all requests with:

Blocked: resolves to private/internal/special-use IP address

This is because resolveAndValidateIP() does DNS resolution and rejects IPs in the 198.18.0.0/15 range. TUN mode proxies hijack all DNS to fake IPs in this range.

Current Behavior

  • Telegram channel already has an allowPrivateIP config option for exactly this scenario (fake-ip/transparent-proxy environments)
  • Image generation has no such option — the SSRF check is hardcoded

Expected Behavior

  1. Add an allowPrivateIP / skipIPValidation config option for image generation (like Telegram already has)
  2. Or don't apply SSRF checks to well-known API endpoints

Environment

  • macOS Apple Silicon
  • Proxy: TUN/fake-ip mode (198.18.0.0/15)
  • OpenClaw v2026.4.8

extent analysis

TL;DR

Add an allowPrivateIP or skipIPValidation config option to the image generation tool to bypass SSRF checks for private IP addresses.

Guidance

  • Identify the resolveAndValidateIP() function and consider modifying it to accept a configuration option to skip IP validation for specific use cases.
  • Review the Telegram channel's allowPrivateIP config option implementation as a reference for adding a similar option to the image generation tool.
  • Consider whitelisting well-known API endpoints to exclude them from SSRF checks.
  • Evaluate the security implications of bypassing SSRF checks and ensure that the added config option does not introduce vulnerabilities.

Example

# Example of how the config option could be implemented
def resolveAndValidateIP(ip, allow_private_ip=False):
    if allow_private_ip and ip_address(ip) in ip_network('198.18.0.0/15'):
        return ip
    # existing validation logic

Notes

The solution may require careful consideration of security trade-offs, as bypassing SSRF checks can potentially introduce vulnerabilities. The allowPrivateIP or skipIPValidation config option should be carefully evaluated and tested to ensure it does not compromise the security of the image generation tool.

Recommendation

Apply a workaround by adding an allowPrivateIP or skipIPValidation config option to the image generation tool, as this will provide a targeted solution to the specific use case described, while minimizing potential security risks.

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