openclaw - 💡(How to fix) Fix Telegram file download blocked by SSRF policy when using Fake-IP proxy (172.19.0.1 treated as private IP) [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#62426Fetched 2026-04-08 03:04:24
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Error Message

When OpenClaw runs behind a Clash/Mihomo proxy in Fake-IP mode, Telegram file downloads fail with the following error:

Root Cause

The channels.telegram.network.dangerouslyAllowPrivateNetwork setting only controls the Telegram Bot API communication layer (grammY client), but file downloads are performed via a separate internal HTTP fetch call that goes through the SSRF security module. The SSRF module does not respect channels.telegram.network.dangerouslyAllowPrivateNetwork and blocks the private IP directly.

Fix Action

Workaround

Add DOMAIN-SUFFIX,api.telegram.org,DIRECT to the Clash/Mihomo proxy rules to bypass the proxy for Telegram API requests, avoiding Fake-IP resolution.

Code Example

[security] blocked URL fetch (url-fetch) target=https://api.telegram.org/file/botXXXXXXXX:AAH.../photos/file_XX.jpg reason=Blocked hostname (not in allowlist): 172.19.0.1

---

{
  "channels": {
    "telegram": {
      "enabled": true,
      "proxy": "http://172.19.0.1:7897",
      "network": {
        "dangerouslyAllowPrivateNetwork": true
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Bug Description

When OpenClaw runs behind a Clash/Mihomo proxy in Fake-IP mode, Telegram file downloads fail with the following error:

[security] blocked URL fetch (url-fetch) target=https://api.telegram.org/file/botXXXXXXXX:AAH.../photos/file_XX.jpg reason=Blocked hostname (not in allowlist): 172.19.0.1

The proxy resolves api.telegram.org to a private IP (e.g. 172.19.0.1) in Fake-IP mode, and the SSRF security module blocks the request.

Steps to Reproduce

  1. Configure OpenClaw with a Telegram channel
  2. Configure the Telegram channel to use a HTTP proxy (e.g. channels.telegram.proxy: "http://172.19.0.1:7897")
  3. Ensure the proxy runs in Fake-IP DNS mode — this causes all DNS resolutions to return fake private IPs
  4. Send a file via the Telegram bot (or forward a file to the bot)
  5. OpenClaw attempts to download the file via api.telegram.org/file/...
  6. The fetch resolves to a private IP (e.g. 172.19.0.1) and is blocked

Expected Behavior

Telegram files should download successfully. Even when proxy resolves the hostname to a private IP, the channels.telegram.network.dangerouslyAllowPrivateNetwork: true config should permit the request.

Actual Behavior

The request is blocked at the SSRF layer with Blocked hostname (not in allowlist): 172.19.0.1.

Configuration

{
  "channels": {
    "telegram": {
      "enabled": true,
      "proxy": "http://172.19.0.1:7897",
      "network": {
        "dangerouslyAllowPrivateNetwork": true
      }
    }
  }
}

Environment

  • OpenClaw version: 2026.4.5
  • Platform: WSL2 / Linux
  • Proxy: Clash/Mihomo with Fake-IP DNS mode
  • Telegram channel configured with proxy

Root Cause Analysis

The channels.telegram.network.dangerouslyAllowPrivateNetwork setting only controls the Telegram Bot API communication layer (grammY client), but file downloads are performed via a separate internal HTTP fetch call that goes through the SSRF security module. The SSRF module does not respect channels.telegram.network.dangerouslyAllowPrivateNetwork and blocks the private IP directly.

Suggested Fix

Either:

  1. Make channels.telegram.network.dangerouslyAllowPrivateNetwork also apply to Telegram file download HTTP fetch calls, OR
  2. Add a new config path like channels.telegram.network.ssrfPolicy.dangerouslyAllowPrivateNetwork specifically for file downloads, OR
  3. Document that api.telegram.org should be added to a hostname allowlist in the SSRF policy

Workaround

Add DOMAIN-SUFFIX,api.telegram.org,DIRECT to the Clash/Mihomo proxy rules to bypass the proxy for Telegram API requests, avoiding Fake-IP resolution.

extent analysis

TL;DR

Add DOMAIN-SUFFIX,api.telegram.org,DIRECT to the Clash/Mihomo proxy rules to bypass the proxy for Telegram API requests.

Guidance

  • Verify that the channels.telegram.network.dangerouslyAllowPrivateNetwork setting is correctly configured and applied to the Telegram Bot API communication layer.
  • Check the SSRF security module configuration to ensure it is not blocking the private IP addresses.
  • Consider adding api.telegram.org to a hostname allowlist in the SSRF policy as a potential fix.
  • Test the workaround by adding the DOMAIN-SUFFIX,api.telegram.org,DIRECT rule to the Clash/Mihomo proxy rules and verify that Telegram file downloads are successful.

Example

No code snippet is provided as the issue is related to configuration and proxy settings.

Notes

The provided workaround may not be a permanent solution and may have implications for the security and functionality of the system. It is recommended to investigate and implement a more permanent fix, such as modifying the channels.telegram.network.dangerouslyAllowPrivateNetwork setting or adding a new config path for file downloads.

Recommendation

Apply the workaround by adding DOMAIN-SUFFIX,api.telegram.org,DIRECT to the Clash/Mihomo proxy rules, as it provides a temporary solution to the issue and allows for further investigation and implementation of a more permanent fix.

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