PHP-018 / 高级
SSRF:服务器请求用户指定的 URL
为什么存在问题?
可访问内部网络,包括 169.254.169.254 元数据及 localhost 管理 API。
如何修复
php
$endpoint = config('integrations.endpoints')[$serviceId] ?? null;
abort_if($endpoint === null, 422);
Http::withoutRedirecting()->get($endpoint);