fix(telegram): allow RFC 2544 benchmark IPs in media download SSRF policy (#57452)#57624
Conversation
Greptile SummaryThis PR fixes a targeted SSRF policy misconfiguration in the Telegram media downloader.
Confidence Score: 5/5Safe 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.
|
| 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
…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.
32cb0fa to
2330500
Compare
obviyus
left a comment
There was a problem hiding this comment.
Reviewed latest changes; landing now.
…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) * 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) * 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) * 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) * 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) * 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) * 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]>
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()inextensions/telegram/src/bot/delivery.resolve-media.tssetallowRfc2544BenchmarkRange: falsewhile Discord and Slack both set it totrue. 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: changeallowRfc2544BenchmarkRangefromfalsetotrue, matching Discord and Slack behaviorextensions/telegram/src/bot/delivery.resolve-media-retry.test.ts: update test expectations to matchTest
All 23 tests pass in
delivery.resolve-media-retry.test.ts.Closes #57452
Closes #57564