fix: allowlist Discord CDN hostnames for SSRF media (#33275) (thanks @thewilloftheshadow) (#33275)

This commit is contained in:
Shadow
2026-03-03 11:17:27 -06:00
committed by GitHub
parent bf7061092a
commit a7a9a3d3c8
4 changed files with 129 additions and 13 deletions

View File

@@ -104,11 +104,13 @@ export async function processDiscordMessage(ctx: DiscordMessagePreflightContext)
discordRestFetch,
} = ctx;
const mediaList = await resolveMediaList(message, mediaMaxBytes, discordRestFetch);
const ssrfPolicy = cfg.browser?.ssrfPolicy;
const mediaList = await resolveMediaList(message, mediaMaxBytes, discordRestFetch, ssrfPolicy);
const forwardedMediaList = await resolveForwardedMediaList(
message,
mediaMaxBytes,
discordRestFetch,
ssrfPolicy,
);
mediaList.push(...forwardedMediaList);
const text = messageText;