mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 09:40:21 +00:00
fix: allow Telegram RFC2544 media downloads (#57624) (thanks @MoerAI)
* fix(telegram): allow RFC 2544 benchmark IPs in media download SSRF policy (#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 (#57624) (thanks @MoerAI) --------- Co-authored-by: Ayaan Zaidi <hi@obviy.us>
This commit is contained in:
@@ -155,7 +155,7 @@ async function expectTransientGetFileRetrySuccess() {
|
||||
expect.objectContaining({
|
||||
url: `https://api.telegram.org/file/bot${BOT_TOKEN}/voice/file_0.oga`,
|
||||
ssrfPolicy: {
|
||||
allowRfc2544BenchmarkRange: false,
|
||||
allowRfc2544BenchmarkRange: true,
|
||||
hostnameAllowlist: ["api.telegram.org"],
|
||||
},
|
||||
}),
|
||||
@@ -533,7 +533,7 @@ describe("resolveMedia original filename preservation", () => {
|
||||
ssrfPolicy: {
|
||||
hostnameAllowlist: ["api.telegram.org", "192.168.1.50"],
|
||||
allowedHostnames: ["192.168.1.50"],
|
||||
allowRfc2544BenchmarkRange: false,
|
||||
allowRfc2544BenchmarkRange: true,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -41,7 +41,7 @@ function buildTelegramMediaSsrfPolicy(apiRoot?: string) {
|
||||
// enforcing SSRF checks on the resolved and redirected targets.
|
||||
hostnameAllowlist: hostnames,
|
||||
...(allowedHostnames ? { allowedHostnames } : {}),
|
||||
allowRfc2544BenchmarkRange: false,
|
||||
allowRfc2544BenchmarkRange: true,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user