← PHP / Laravel 목차

PHP-092 / 고급

XML Billion Laughs (엔티티 확장 DoS)

A05:2021 Security Misconfiguration · CWE-776 Improper Restriction of Recursive Entity References

왜 문제가 될까요?

중첩 엔티티로 수 GB의 메모리 확장이 일어난다.

이렇게 수정하세요

php
$dom = new DOMDocument(); $dom->loadXML($request->getContent(), LIBXML_NONET);  // NOENT 제거, 크기 제한

더 읽기