🇰🇷 한글 설명
Dompdf 3.15 및 이전 버전에서 validateLocalUri() 메서드가 chroot 경계를 검증할 때 경로 정규화 과정의 허점으로 인해 발생합니다. 경로 정규화 시 마지막 디렉터리 구분자가 제거되어, 설정된 chroot 경로가 형제 디렉터리(예: /var/www2)와도 일치하는 것으로 오인될 수 있습니다. 공격자가 렌더링되는 HTML을 제어할 수 있다면 chroot를 탈출하여 허용되지 않은 민감한 파일을 읽을 수 있습니다.
💡 쉬운 설명
파일 접근 제한 규칙이 완벽하지 않아, 허용된 폴더 옆에 있는 다른 폴더의 파일까지 몰래 읽을 수 있는 보안 약점입니다. 공격자가 조작된 HTML 파일을 통해 서버의 중요한 정보를 훔쳐갈 위험이 있습니다.
🇺🇸 원문 (English)
Dompdf is an HTML to PDF converter for PHP. In versions 3.15 and prior, the validateLocalUri() method enforces chroot boundaries with a strpos() prefix check after normalizing paths with realpath() . Because normalization strips the trailing directory separator from $chrootPath , the check only verifies that $chrootPath is a string prefix of $realfile, so a chroot of /var/www also matches sibling directories like /var/www2 , /var/www-admin, or /var/www_backup. An attacker who controls part of the rendered HTML could exploit this to escape the chroot and read sensitive files outside the allowed directory. This issue has been fixed in version 3.16.
📍 영향받는 시스템
Dompdf 3.15 및 그 이전 모든 버전
⚔️ 공격 벡터
조작된 HTML을 통한 chroot 경계 우회 및 임의 파일 읽기
🛡️ 대응 방법
Dompdf를 최신 버전인 3.16 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 정보가 3.16 미만(예: 3.15.x)이면 취약한 상태입니다.
composer show dompdf/dompdf | grep 'versions'