← PHP / Laravel 목차

PHP-100 / 기초

개발 의존성·테스트 파일을 운영 배포에 포함

A05:2021 Security Misconfiguration · CWE-489 Active Debug Code · A06:2021 (범위 축소)

왜 문제가 될까요?

tests/, .git/, phpunit.xml 이 웹에서 열리거나 공격 표면을 늘린다.

이렇게 수정하세요

bash
composer install --no-dev --optimize-autoloader
rsync -a --exclude '.git' --exclude 'tests' ./ /var/www/app/
# 웹 서버에서 .git, tests 차단, public 만 문서 루트

더 읽기