🇰🇷 한글 설명
PHP가 표준이 아닌 HTTP 메서드(예: 'PoSt', 'gEt')를 GET 요청으로 처리하여 접근 제한을 우회할 수 있습니다. Apache httpd 2.0과 같이 모든 메서드를 통과시키는 서버에서 Limit 지시어로 설정한 접근 제어가 무효화됩니다.
💡 쉬운 설명
웹서버가 뭔가 이상한 요청 방식을 받으면 정상 요청처럼 처리해서 권한이 없는 페이지에 접근할 수 있습니다. 예를 들어 POST만 허용되는 페이지에 '포스트' 같은 잘못된 철자로 요청하면 GET처럼 작동합니다.
🇺🇸 원문 (English)
PHP treats unknown methods such as "PoSt" as a GET request, which could allow attackers to intended access restrictions if PHP is running on a server that passes on all methods, such as Apache httpd 2.0, as demonstrated using a Limit directive. NOTE: this issue has been disputed by the Apache security team, saying "It is by design that PHP allows scripts to process any request method. A script which does not explicitly verify the request method will hence be processed as normal for arbitrary methods. It is therefore expected behaviour that one cannot implement per-method access control using the Apache configuration alone, which is the assumption made in this report.
📍 영향받는 시스템
Apache httpd 2.0, PHP (모든 버전, 메서드 검증 없는 스크립트)
⚔️ 공격 벡터
비표준 HTTP 메서드(PoSt, gEt, paTch 등)를 사용한 요청으로 메서드 기반 접근 제어 우회
🛡️ 대응 방법
PHP 코드에서 $_SERVER['REQUEST_METHOD']를 명시적으로 검증하고, 서버 설정 대신 애플리케이션 레벨에서 메서드 제한 구현
🔧 검증 코드
HTTP 응답 코드가 200이면 POST 제한이 무효화된 것, 405/403이면 보호됨. Allow 헤더에 명시된 메서드만 허용되는지 확인.
curl -X POST http://target.example.com/restricted.php -v 2>&1 | grep -E 'HTTP/|Allow'