Skip to content

fix(telegram): allow RFC 2544 benchmark IPs in media download SSRF policy (#57452)#57624

Merged
obviyus merged 2 commits into
openclaw:mainfrom
MoerAI:fix/telegram-media-ssrf-rfc2544
Mar 31, 2026
Merged

fix(telegram): allow RFC 2544 benchmark IPs in media download SSRF policy (#57452)#57624
obviyus merged 2 commits into
openclaw:mainfrom
MoerAI:fix/telegram-media-ssrf-rfc2544

Conversation

@MoerAI

@MoerAI MoerAI commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Telegram CDN file servers sometimes resolve to IPs in the RFC 2544 benchmark range (198.18.0.0/15). The Telegram SSRF policy set allowRfc2544BenchmarkRange: false, blocking legitimate media downloads and causing "Failed to download media" errors for voice messages, PDFs, and other files.

Root Cause

buildTelegramMediaSsrfPolicy() in extensions/telegram/src/bot/delivery.resolve-media.ts set allowRfc2544BenchmarkRange: false while Discord and Slack both set it to true. When Telegram's CDN servers resolve to addresses in the 198.18.0.0/15 range, the SSRF check rejects the download.

Changes

  • extensions/telegram/src/bot/delivery.resolve-media.ts: change allowRfc2544BenchmarkRange from false to true, matching Discord and Slack behavior
  • extensions/telegram/src/bot/delivery.resolve-media-retry.test.ts: update test expectations to match

Test

All 23 tests pass in delivery.resolve-media-retry.test.ts.

Closes #57452
Closes #57564

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: XS labels Mar 30, 2026
@greptile-apps

greptile-apps Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a targeted SSRF policy misconfiguration in the Telegram media downloader. buildTelegramMediaSsrfPolicy() had allowRfc2544BenchmarkRange: false, which blocked downloads when Telegram's CDN resolves to IPs in the 198.18.0.0/15 benchmark range. Setting it to true brings Telegram in line with the Discord and Slack integrations, which already allow this range.

  • delivery.resolve-media.ts: allowRfc2544BenchmarkRange flipped from falsetrue in buildTelegramMediaSsrfPolicy().
  • delivery.resolve-media-retry.test.ts: Two test assertions updated to match the new value; all 23 tests pass.
  • The fix is consistent with extensions/discord/src/monitor/message-utils.ts and extensions/slack/src/monitor/media.ts, both of which already set this flag to true.

Confidence Score: 5/5

Safe to merge — the change is a one-line targeted fix that aligns Telegram with Discord/Slack behavior and is fully covered by existing tests.

The diff is two changed lines in production code and two updated test assertions. The fix matches the established pattern in Discord and Slack integrations, no logic is altered beyond the single flag, and all tests pass. No P0 or P1 issues were found.

No files require special attention.

Important Files Changed

Filename Overview
extensions/telegram/src/bot/delivery.resolve-media.ts Single-line fix: allowRfc2544BenchmarkRange changed from false to true, aligning with Discord and Slack SSRF policies.
extensions/telegram/src/bot/delivery.resolve-media-retry.test.ts Two test assertions updated to reflect the new allowRfc2544BenchmarkRange: true value; no other test logic changed.

Reviews (1): Last reviewed commit: "fix(telegram): allow RFC 2544 benchmark ..." | Re-trigger Greptile

@obviyus obviyus self-assigned this Mar 31, 2026
MoerAI and others added 2 commits March 31, 2026 09:50
…licy (openclaw#57452)

Telegram CDN file servers may resolve to IPs in the RFC 2544 benchmark range (198.18.0.0/15). The SSRF policy blocked these downloads while Discord and Slack correctly allowed them. Set allowRfc2544BenchmarkRange to true to match other channel plugins.
@obviyus
obviyus force-pushed the fix/telegram-media-ssrf-rfc2544 branch from 32cb0fa to 2330500 Compare March 31, 2026 04:22

@obviyus obviyus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed latest changes; landing now.

@obviyus
obviyus merged commit e89bd88 into openclaw:main Mar 31, 2026
20 checks passed
@obviyus

obviyus commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Landed on main.

Thanks @MoerAI.

pgondhi987 pushed a commit to pgondhi987/openclaw that referenced this pull request Mar 31, 2026
…MoerAI)

* fix(telegram): allow RFC 2544 benchmark IPs in media download SSRF policy (openclaw#57452)

Telegram CDN file servers may resolve to IPs in the RFC 2544 benchmark range (198.18.0.0/15). The SSRF policy blocked these downloads while Discord and Slack correctly allowed them. Set allowRfc2544BenchmarkRange to true to match other channel plugins.

* fix: note Telegram media RFC2544 CDN downloads (openclaw#57624) (thanks @MoerAI)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
pgondhi987 pushed a commit to pgondhi987/openclaw that referenced this pull request Mar 31, 2026
…MoerAI)

* fix(telegram): allow RFC 2544 benchmark IPs in media download SSRF policy (openclaw#57452)

Telegram CDN file servers may resolve to IPs in the RFC 2544 benchmark range (198.18.0.0/15). The SSRF policy blocked these downloads while Discord and Slack correctly allowed them. Set allowRfc2544BenchmarkRange to true to match other channel plugins.

* fix: note Telegram media RFC2544 CDN downloads (openclaw#57624) (thanks @MoerAI)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
@MoerAI
MoerAI deleted the fix/telegram-media-ssrf-rfc2544 branch April 27, 2026 11:04
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…MoerAI)

* fix(telegram): allow RFC 2544 benchmark IPs in media download SSRF policy (openclaw#57452)

Telegram CDN file servers may resolve to IPs in the RFC 2544 benchmark range (198.18.0.0/15). The SSRF policy blocked these downloads while Discord and Slack correctly allowed them. Set allowRfc2544BenchmarkRange to true to match other channel plugins.

* fix: note Telegram media RFC2544 CDN downloads (openclaw#57624) (thanks @MoerAI)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
…MoerAI)

* fix(telegram): allow RFC 2544 benchmark IPs in media download SSRF policy (openclaw#57452)

Telegram CDN file servers may resolve to IPs in the RFC 2544 benchmark range (198.18.0.0/15). The SSRF policy blocked these downloads while Discord and Slack correctly allowed them. Set allowRfc2544BenchmarkRange to true to match other channel plugins.

* fix: note Telegram media RFC2544 CDN downloads (openclaw#57624) (thanks @MoerAI)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…MoerAI)

* fix(telegram): allow RFC 2544 benchmark IPs in media download SSRF policy (openclaw#57452)

Telegram CDN file servers may resolve to IPs in the RFC 2544 benchmark range (198.18.0.0/15). The SSRF policy blocked these downloads while Discord and Slack correctly allowed them. Set allowRfc2544BenchmarkRange to true to match other channel plugins.

* fix: note Telegram media RFC2544 CDN downloads (openclaw#57624) (thanks @MoerAI)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
…MoerAI)

* fix(telegram): allow RFC 2544 benchmark IPs in media download SSRF policy (openclaw#57452)

Telegram CDN file servers may resolve to IPs in the RFC 2544 benchmark range (198.18.0.0/15). The SSRF policy blocked these downloads while Discord and Slack correctly allowed them. Set allowRfc2544BenchmarkRange to true to match other channel plugins.

* fix: note Telegram media RFC2544 CDN downloads (openclaw#57624) (thanks @MoerAI)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
Nachx639 pushed a commit to Nachx639/clawdbot that referenced this pull request Jun 17, 2026
…MoerAI)

* fix(telegram): allow RFC 2544 benchmark IPs in media download SSRF policy (openclaw#57452)

Telegram CDN file servers may resolve to IPs in the RFC 2544 benchmark range (198.18.0.0/15). The SSRF policy blocked these downloads while Discord and Slack correctly allowed them. Set allowRfc2544BenchmarkRange to true to match other channel plugins.

* fix: note Telegram media RFC2544 CDN downloads (openclaw#57624) (thanks @MoerAI)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram size: XS

Projects

None yet

2 participants