🇰🇷 한글 설명
WordPress HTTP Headers 플러그인 1.19.2 이하에서 파일 경로 검증이 부족하여 관리자가 임의의 파일 경로에 접근할 수 있습니다. 사용자명이 새니타이제이션 없이 파일에 기록되어 PHP 코드를 포함한 임의의 파일을 서버에 작성할 수 있습니다.
💡 쉬운 설명
WordPress 플러그인이 파일을 어디에 저장할지 제대로 확인하지 않습니다. 관리자 권한이 있으면 악의적인 코드를 서버에 저장해 시스템을 완전히 장악할 수 있습니다.
🇺🇸 원문 (English)
The HTTP Headers plugin for WordPress is vulnerable to External Control of File Name or Path leading to Remote Code Execution in all versions up to and including 1.19.2. This is due to insufficient validation of the file path stored in the 'hh_htpasswd_path' option and lack of sanitization on the 'hh_www_authenticate_user' option value. The plugin allows administrators to set an arbitrary file path for the htpasswd file location and does not validate that the path has a safe file extension (e.g., restricting to .htpasswd). Additionally, the username field used for HTTP Basic Authentication is written directly into the file without sanitization. The apache_auth_credentials() function constructs the file content using the unsanitized username via sprintf('%s:{SHA}%s', $user, ...), and update_auth_credentials() writes this content to the attacker-controlled path via file_put_contents(). This makes it possible for authenticated attackers, with Administrator-level access and above, to write arbitrary content (including PHP code) to arbitrary file paths on the server, effectively achieving Remote Code Execution.
📍 영향받는 시스템
WordPress HTTP Headers plugin version ≤ 1.19.2
⚔️ 공격 벡터
관리자가 'hh_htpasswd_path' 옵션에 임의의 파일 경로를 설정하고 'hh_www_authenticate_user'에 PHP 코드를 포함시켜 파일 작성
🛡️ 대응 방법
플러그인을 1.19.3 이상으로 업데이트하거나 비활성화/삭제
🔧 검증 코드
버전 번호가 1.19.2 이하이면 취약, 1.19.3 이상이면 패치됨
grep 'Version:' wp-content/plugins/*/readme.txt 2>/dev/null | head -1