🇰🇷 한글 설명
WordPress Zakra 테마 4.2.0 이하 버전에는 post meta 값을 통한 저장형 크로스사이트 스크립팅(XSS) 취약점이 존재합니다. REST API 경로에서 sanitize 없이 저장된 메타 값이 CSS로 출력되어, 기여자(Contributor) 이상 권한의 공격자가 임의의 스크립트를 삽입할 수 있습니다.
💡 쉬운 설명
글을 올릴 수 있는 권한을 가진 사람이 페이지에 악성 스크립트를 숨겨 넣을 수 있는 문제입니다. 그 페이지를 방문한 다른 사용자의 브라우저에서 해당 스크립트가 실행될 수 있습니다.
🇺🇸 원문 (English)
The Zakra theme for WordPress is vulnerable to Stored Cross-Site Scripting via post meta values in all versions up to, and including, 4.2.0. This is due to the theme registering three post meta fields (zakra_menu_item_color, zakra_menu_item_hover_color, and zakra_menu_item_active_color) with 'show_in_rest' => true and 'auth_callback' => '__return_true', but without any sanitize_callback parameter in the register_post_meta() calls. While the classic editor save path applies sanitize_hex_color() sanitization, the REST API path completely bypasses this protection. The unsanitized meta values are then retrieved via get_post_meta() and concatenated directly into CSS strings that are output through wp_add_inline_style() without any escaping. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses the injected page.
📍 영향받는 시스템
WordPress Zakra 테마 4.2.0 이하 모든 버전
⚔️ 공격 벡터
기여자 이상 권한의 공격자가 REST API로 zakra_menu_item_* 메타 값에 스크립트를 주입하여 저장한 뒤, 해당 페이지를 사용자가 열면 스크립트가 실행됨
🛡️ 대응 방법
Zakra 테마를 4.2.1 이상 버전으로 업데이트하거나, 취약 버전을 사용하지 않도록 조치하고 신뢰할 수 없는 사용자의 기여자 권한을 제한합니다.
🔧 검증 코드
출력된 버전이 4.2.0 이하이면 취약하며, 4.2.1 이상이면 패치된 버전입니다. 명령 결과가 없으면 WP-CLI 설치 여부 또는 테마 설치 여부를 확인하세요.
wp theme list --name=zakra --field=version 2>/dev/null