← PHP / Laravel 목차

PHP-018 / 고급

SSRF: 사용자 지정 URL을 서버가 요청

A10:2021 Server-Side Request Forgery · CWE-918 SSRF

왜 문제가 될까요?

내부망(169.254.169.254 메타데이터, localhost 관리 API) 접근이 가능하다.

이렇게 수정하세요

php
$endpoint = config('integrations.endpoints')[$serviceId] ?? null;
abort_if($endpoint === null, 422);
Http::withoutRedirecting()->get($endpoint);

더 읽기