Smash Balloon Social Post Feed 插件中修補的安全問題

已發表: 2021-10-29

在對 Smash Balloon 社交帖子訂閱源插件(也稱為自定義 Facebook 訂閱源)進行內部審計期間,我們發現在易受攻擊的網站上擁有帳戶的任何用戶(如訂閱者)都可以訪問幾個敏感的 AJAX 端點。 其中一些端點可能使存儲跨站點腳本 (XSS) 攻擊發生。

成功的存儲型 XSS 攻擊可以使不良行為者在受影響站點的每個帖子和頁面上存儲惡意腳本。 如果登錄的管理員訪問受影響的 URL 之一,該腳本可能會在他們的瀏覽器上運行並代表他們執行管理操作,例如創建新管理員和安裝惡意插件。

我們通過電子郵件向該插件的作者報告了這些漏洞,他們最近發布了 4.0.1 版本來解決這些問題。 我們強烈建議您更新到最新版本的 Smash Balloon Social Post Feed 插件,並在您的網站上安裝成熟的安全解決方案,例如 Jetpack Security。

細節

插件名稱: Smash Balloon Social Post Feed
插件 URI: https://wordpress.org/plugins/custom-facebook-feed/
作者:粉碎氣球
作者 URI: https://smashballoon.com/

漏洞

通過任意設置更新存儲的跨站點腳本

受影響的版本: < 4.0.1
CVE-ID: CVE-2021-24918
CVSSv3.1: 7.3
CWSS: 80.6

        public function cff_save_settings() {
                $data = $_POST;
                $model = isset( $data[ 'model' ] ) ? $data['model'] : null;
                // return if the model is null
                if ( null === $model ) {
                        return;
                }
                
                // (...)

                $model = (array) \json_decode( \stripslashes( $model ) );
                $general = (array) $model['general'];
                $feeds = (array) $model['feeds'];
                $translation = (array) $model['translation'];
                $advanced = (array) $model['advanced'];
                // Get the values and sanitize
                $cff_locale                                                     = sanitize_text_field( $feeds['selectedLocale'] );
                $cff_style_settings                                     = get_option( 'cff_style_settings' );
                $cff_style_settings[ 'cff_timezone' ]   = sanitize_text_field( $feeds['selectedTimezone'] );
                $cff_style_settings[ 'cff_custom_css' ] = $feeds['customCSS'];
                $cff_style_settings[ 'cff_custom_js' ]  = $feeds['customJS'];
                $cff_style_settings[ 'gdpr' ]                   = sanitize_text_field( $feeds['gdpr'] );
                $cachingType                                                    = sanitize_text_field( $feeds['cachingType'] );
                $cronInterval                                                   = sanitize_text_field( $feeds['cronInterval'] );
                $cronTime                                                               = sanitize_text_field( $feeds['cronTime'] );
                $cronAmPm                                                               = sanitize_text_field( $feeds['cronAmPm'] );
                $cacheTime                                                              = sanitize_text_field( $feeds['cacheTime'] );
                $cacheTimeUnit                                                  = sanitize_text_field( $feeds['cacheTimeUnit'] );
                // Save general settings data
                update_option( 'cff_preserve_settings', $general['preserveSettings'] );
                // Save feeds settings data
                update_option( 'cff_locale', $cff_locale );

                // (...)

                // Save translation settings data
                foreach( $translation as $key => $val ) {
                        $cff_style_settings[ $key ] = $val;
                }
                // Save advanced settings data
                $cff_ajax = sanitize_text_field( $advanced['cff_ajax'] );
                foreach( $advanced as $key => $val ) {
                        if ( $key == 'cff_disable_resize' || $key == 'disable_admin_notice' ) {
                                $cff_style_settings[ $key ] = !$val;
                        } else {
                                $cff_style_settings[ $key ] = $val;
                        }
                }

                // (...)

                update_option( 'cff_ajax', $cff_ajax );
                // Update the cff_style_settings option that contains data for translation and advanced tabs
                update_option( 'cff_style_settings', $cff_style_settings );
                // clear cron caches
                $this->cff_clear_cache();
                new CFF_Response( true, array(
                        'cronNextCheck' => $this->get_cron_next_check()
                ) );
        }

負責更新插件內部設置的wp_ajax_cff_save_settings AJAX 操作在執行此操作之前沒有執行任何特權或隨機數檢查。 這使得任何登錄用戶都可以調用此操作並更新任何插件的設置。

不幸的是,其中一項設置customJS使管理員能夠將自定義 JavaScript 存儲在其站點的帖子和頁面上。 更新此設置是不良行為者在網站上存儲惡意腳本所需要的全部內容。

時間線

2021-10-14 – 初次接觸 Smash Balloon
2021-10-18 – 我們向他們發送有關這些漏洞的詳細信息
2021-10-21 – Smash Balloon Social Post Feed 4.0.1 發布

結論

我們建議您檢查您的站點使用的 Smash Balloon Social Post Feed 插件的版本,如果低於 4.0.1,請盡快更新!

在 Jetpack,我們努力確保您的網站免受此類漏洞的影響。 我們建議您為您的站點制定一個安全計劃,其中包括惡意文件掃描和備份。 Jetpack Security 是一種出色的 WordPress 安全選項,可確保您的網站和訪問者的安全。

學分

原始研究員:馬克·蒙帕斯

感謝 Jetpack Scan 團隊的其他成員提供反饋、幫助和更正。