🇰🇷 한글 설명
WPCode WordPress 플러그인 2.3.5 이하 버전에서 'wpcode' 커스텀 포스트 타입이 적절한 권한 제한 없이 등록되어 있습니다. 이로 인해 저자 이상의 권한을 가진 인증된 공격자가 XML-RPC를 통해 PHP 코드를 포함한 스니펫을 생성하고 게시할 수 있습니다. 이 스니펫은 [wpcode] 숏코드 렌더링 시 eval() 함수로 서버에서 실행되어 원격 코드 실행 취약점을 야기합니다.
💡 쉬운 설명
WordPress의 WPCode 플러그인에서 일반 사용자도 위험한 코드를 서버에서 실행하도록 할 수 있습니다. 플러그인이 저자 권한의 사용자가 PHP 코드를 올릴 수 있도록 방치하고 있기 때문입니다.
🇺🇸 원문 (English)
The WPCode - Insert Headers and Footers + Custom Code Snippets - WordPress Code Manager plugin for WordPress is vulnerable to Remote Code Execution in versions up to, and including, 2.3.5 This is due to the 'wpcode' custom post type being registered without a custom capability_type or capability restrictions in the wpcode_register_post_type() function, allowing WordPress core to fall back to standard post capabilities for all creation paths including XML-RPC. This makes it possible for authenticated attackers, with author-level access and above, to create and publish executable PHP snippet posts via XML-RPC wp.newPost, which are then executed server-side via eval() in the run_eval() function when the snippet is rendered through the [wpcode] shortcode.
📍 영향받는 시스템
WPCode - Insert Headers and Footers + Custom Code Snippets 플러그인 버전 2.3.5 이하
⚔️ 공격 벡터
인증된 저자 권한 이상의 사용자가 XML-RPC wp.newPost를 통해 악성 PHP 스니펫을 게시하고 [wpcode] 숏코드로 실행
🛡️ 대응 방법
WPCode 플러그인을 2.3.6 이상으로 즉시 업데이트하고 XML-RPC 접근 제한 및 저자 권한 검토
🔧 검증 코드
2.3.5 이하의 버전이 출력되면 취약점 존재, 2.3.6 이상이면 패치됨
grep 'Version:' /var/www/html/wp-content/plugins/wpcode/wpcode.php 2>/dev/null | grep -oP '\d+\.\d+\.\d+'