From d2c8d92c2c9349cdb94c879ad1be9d37da3544be Mon Sep 17 00:00:00 2001 From: RelaxJonh <92573950+RelaxJonh@users.noreply.github.com> Date: Fri, 14 Aug 2026 20:31:13 +0700 Subject: [PATCH] fix: add bots.qq.com and api.sgroup.qq.com to SSRF trusted hosts QQ Bot adapter fails to connect in mainland China because DNS fake IP (198.18.0.0/15) is blocked by SSRF protection. Commit a97b08e added multimedia.nt.qq.com.cn to _TRUSTED_PRIVATE_IP_HOSTS, but QQ Bot also uses bots.qq.com (OAuth token endpoint) and api.sgroup.qq.com (WebSocket gateway), both of which resolve to the same benchmark IP range. Fixes #86081 --- tools/url_safety.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/url_safety.py b/tools/url_safety.py index 6442fe4bf55fc..95b860fd50ca1 100644 --- a/tools/url_safety.py +++ b/tools/url_safety.py @@ -199,6 +199,8 @@ _ALWAYS_BLOCKED_NETWORKS = ( # to 198.18.0.0/15 behind local proxy/benchmark infrastructure. _TRUSTED_PRIVATE_IP_HOSTS = frozenset({ "multimedia.nt.qq.com.cn", + "bots.qq.com", + "api.sgroup.qq.com", }) _MAX_SSRF_CONNECT_IPS = 8