Skip to content

Commit 05348f4

Browse files
authored
Version: 2.175.
2.175
2 parents 8847bfb + bab6b56 commit 05348f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1749
-1103
lines changed

changelog.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
== Changelog ==
22

3+
= 2.162 Aug 18 2025
4+
* New. PassCheck. Users passwords checking for information leaks functionality implemented
5+
* Fix. CSS. Editing the logo position on the authorization page
6+
* Fix. Scan. Fixed cure behavior on view when file deleted.
7+
8+
= 2.161 Aug 04 2025
9+
* Fix. Code. Code direct call preventing.
10+
* Fix. CSS. Login notification.
11+
* Fix. SecurityLog. Fixed getting role capabilities.
12+
* Fix. UploadChecker. Skip binary files check.
13+
* Mod. Scanner. HeuristicAnalyser. Compatibility of classes for using entropy with php 5.6
14+
* New. DoingItWrongHandler class. Collect all SPBC errors, suppress remote calls translation errors.
15+
* New. Scanner. OSCron. Signature analysis of cron tasks. Minor visual updates.
16+
* Revert "Upd. CSS. Add const SPBC_OVERRIDE_LOGIN_BODY_DISPLAY to override custom body.login display to "block"."
17+
* Upd. File Editor Disabler. Show last tried config path. Config file getting improved.
18+
* Upd. FireWall. Blocking screen updates.
19+
* Upd. REST. Block REST route "/users". Do not check logged in users.
20+
* Upd. Scanner. Important files listing. Check content of files if response code is 200.
21+
22+
= 2.160 July 14 2025
23+
* Mod. SettingsDesc. Description of suspicious vulnerabilities.
24+
* Mod. RemoteCalls. Updated test calls error formatting.
25+
* Code. Unit Test. Disable admin bar exclaim test.
26+
* Fix. AjaxActions. Added nonce verification.
27+
* Fix. Code. Code direct call prevention.
28+
* Fix. FileEditorDisabler. Do not write error_log. Messages refactored.
29+
* Fix. Admin bar. Hide exclaim sign if no SPBC banners need user attention.
30+
* Fix. VulnerabilityAlarm. Set autoload for option to 'off'.
31+
32+
= 2.159.1 July 10 2025
33+
* Fix. Code. React. Return ErrorBlock component.
34+
335
= 2.159 June 30 2025
436
* New. FileEditorDisabler. New functionality for disabling the file editor
537
* New. FileEditorDisabler. Multisite setup mode, dashboard banners, and settings page

css/spbc-settings.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/src/spbc-settings.css

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,6 @@ div.pagination{
221221
width: 500px;
222222
}
223223

224-
225-
/* Show/hide key link */
226-
#showHideLink{
227-
display: inline-block;
228-
margin-top: 5px;
229-
color: #777;
230-
}
231-
232224
/* Log button */
233225
.spbc__wrapper--center{margin: 10px 0 10px 0; text-align: center;}
234226

@@ -805,47 +797,6 @@ button#spbc_setting_get_key_auto:disabled {
805797
flex-grow: 1;
806798
}
807799

808-
.spbc-quicknav--bar_wrapper {
809-
display: flex;
810-
flex-direction: column;
811-
flex-wrap: nowrap;
812-
justify-content: flex-start;
813-
height: fit-content;
814-
position: sticky;
815-
top: 5vh;
816-
}
817-
818-
.spbc-quicknav--links_wrapper {
819-
display: flex;
820-
flex-direction: column;
821-
flex-wrap: nowrap;
822-
justify-content: center;
823-
padding: 3px;
824-
border: 1px solid #e5e5e5;
825-
margin: 10px;
826-
}
827-
828-
.spbc-quicknav--link{
829-
margin: 3px;
830-
width: -webkit-fill-available;
831-
width: -moz-available;
832-
text-align: left;
833-
display: flex;
834-
flex-direction: row;
835-
justify-content: flex-start;
836-
}
837-
838-
#spbc_quicknav--header {
839-
color: #026E88;
840-
text-align: center;
841-
margin: 5px 0;
842-
}
843-
844-
.spbc_quicknav--save_button {
845-
margin: 10px 5px !important;
846-
height: 40px;
847-
}
848-
849800
.spbc_settings--save_button_custom {
850801
position: sticky;
851802
bottom: 0;

inc/spbc-admin.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use CleantalkSP\SpbctWP\DTO\ReactDataDTO;
77
use CleantalkSP\SpbctWP\Escape;
88
use CleantalkSP\SpbctWP\Scanner\DBTrigger\DBTriggerService;
9+
use CleantalkSP\SpbctWP\Settings\SettingsGeneralReact;
910
use CleantalkSP\SpbctWP\VulnerabilityAlarm\Dto\PluginReport;
1011
use CleantalkSP\SpbctWP\Firewall\View as FirewallView;
1112
use CleantalkSP\SpbctWP\VulnerabilityAlarm\Dto\ThemeReport;
@@ -137,7 +138,6 @@ function spbc_admin_init()
137138
add_action('wp_ajax_spbc_settings__get_description', 'spbc_settings__get_description');
138139
add_action('wp_ajax_spbc_settings__get_recommendation', 'spbc_settings__get_recommendation');
139140
add_action('wp_ajax_spbc_settings__check_renew_banner', 'spbc_settings__check_renew_banner');
140-
add_action('wp_ajax_spbc_sync', 'spbc_sync');
141141
add_action('wp_ajax_spbc_get_key_auto', 'spbc_get_key_auto');
142142
add_action('wp_ajax_spbc_update_account_email', 'spbc_settings__update_account_email');
143143
add_action('wp_ajax_spbc_create_support_user', 'spbc_settings__spbc_create_support_user');
@@ -171,11 +171,13 @@ function spbc_admin_init()
171171

172172
// Drop debug data
173173
if (Post::getString('spbc_debug__drop')) {
174+
spbc_check_ajax_referer('spbc_secret_nonce', 'security');
174175
$spbc->deleteOption('debug', 'use_prefix');
175176
}
176177

177178
// Drop debug data
178179
if (Post::getString('spbc_debug__check_connection')) {
180+
spbc_check_ajax_referer('spbc_secret_nonce', 'security');
179181
$result = spbc_test_connection();
180182
spbc_log($result);
181183
}
@@ -227,6 +229,9 @@ function spbct_get_tab_data()
227229
case 'traffic_control':
228230
wp_send_json(FirewallView::getReactData($data));
229231
break;
232+
case 'settings_general':
233+
wp_send_json(SettingsGeneralReact::getReactData());
234+
break;
230235
case 'spbct_settings_overview':
231236
wp_send_json(spbc_field_options_overview_traffic_light());
232237
break;

inc/spbc-auth.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use CleantalkSP\SpbctWP\Counters\SecurityCounter;
44
use CleantalkSP\SpbctWP\Firewall\WafBlocker;
55
use CleantalkSP\SpbctWP\G2FA\GoogleAuthenticator;
6+
use CleantalkSP\SpbctWP\UsersPassCheckModule\UsersPassCheckModel;
67
use CleantalkSP\SpbctWP\Variables\Cookie;
78
use CleantalkSP\SpbctWP\Helpers\IP;
89
use CleantalkSP\Variables\Get;
@@ -636,6 +637,10 @@ function spbc_passleak_change_password_handler()
636637
wp_die(__('User not found', 'security-malware-firewall'));
637638
}
638639

640+
if ( ! UsersPassCheckModel::isUserPassLeaked($user->ID)) {
641+
wp_safe_redirect(wp_login_url());
642+
}
643+
639644
if ($password_new !== $password_confirm) {
640645
wp_redirect(
641646
wp_login_url()
@@ -661,11 +666,15 @@ function spbc_passleak_change_password_handler()
661666
wp_set_password($password_new, $user->ID);
662667
UsersPassCheckHandler::removeUserPassOnPasswordChange($user->ID);
663668

664-
// set user authenticated
665-
wp_set_auth_cookie($user->ID);
669+
wp_signon([
670+
'user_login' => $user_name,
671+
'user_password' => $password_new
672+
]);
666673

667-
// redirect to dashboard
668-
wp_redirect(admin_url());
674+
$redirect_to = Post::getString('redirect_to') ?: admin_url();
675+
wp_safe_redirect(
676+
wp_sanitize_redirect($redirect_to)
677+
);
669678

670679
exit;
671680
}
@@ -961,7 +970,8 @@ function spbc_2fa__success(\WP_User $user)
961970
}
962971

963972
$redirect_to = remove_query_arg(array('wc_error', 'password-reset', 'spbc_2fa_user'), $redirect_to);
964-
wp_redirect($redirect_to);
973+
$redirect_to = wp_validate_redirect($redirect_to, admin_url());
974+
wp_safe_redirect($redirect_to);
965975
die();
966976
}
967977

inc/spbc-firewall.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,17 @@ function spbc_firewall__check()
5656
$login_url = RenameLoginPage::getURL($spbc->settings['login_page_rename__name']);
5757
}
5858

59+
// Compare only the path part of URLs to avoid scheme mismatch issues
60+
$current_path = parse_url(Server::getURL(), PHP_URL_PATH) ?: Server::get('REQUEST_URI');
61+
$login_path = parse_url($login_url, PHP_URL_PATH) ?: '/wp-login.php';
62+
$is_login_page = strpos(trim($current_path, '/'), trim($login_path, '/')) === 0;
63+
5964
$firewall->loadFwModule(
6065
new BFP(
6166
array(
6267
'api_key' => $spbc->api_key,
6368
'state' => $spbc,
64-
'is_login_page' => strpos(trim(Server::getURL(), '/'), trim($login_url, '/')) === 0,
69+
'is_login_page' => $is_login_page,
6570
'is_logged_in' => Cookie::getString('spbc_is_logged_in') === md5($spbc->data['salt'] . get_option('home')),
6671
'bf_limit' => $spbc->settings['bfp__allowed_wrong_auths'],
6772
'block_period' => $spbc->settings['bfp__block_period__5_fails'],

inc/spbc-settings.php

Lines changed: 10 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -203,71 +203,6 @@ function spbc_settings__register()
203203
'ajax' => true,
204204
'after' => 'spbc_settings_draw_save_button_bottom_block',
205205
'sections' => array(
206-
'section_top_banner' => array(
207-
'type' => 'section_banner',
208-
'fields' => array(
209-
'security_log' => array(
210-
'type' => 'field',
211-
),
212-
),
213-
),
214-
'apikey' => array(
215-
'type' => 'section',
216-
'title' => __('Access Key', 'security-malware-firewall'),
217-
'anchor' => 'apikey',
218-
'fields' => array(
219-
'apikey' => array(
220-
'type' => 'field',
221-
'callback' => 'spbc_field_key'
222-
),
223-
'ms__work_mode' => array(
224-
'type' => 'field',
225-
'input_type' => 'select',
226-
'options' => array(
227-
array(
228-
'val' => 1,
229-
'label' => __('Mutual Account, Individual Access Keys', 'security-malware-firewall'),
230-
'children_enable' => 1,
231-
),
232-
array(
233-
'val' => 2,
234-
'label' => __('Mutual Account, Mutual Access Key', 'security-malware-firewall'),
235-
'children_enable' => 0,
236-
),
237-
array(
238-
'val' => 3,
239-
'label' => __('Individual accounts, individual Access keys', 'security-malware-firewall'),
240-
'children_enable' => 0,
241-
),
242-
),
243-
'title' => __('WordPress Multisite Work Mode', 'security-malware-firewall'),
244-
'description' => __('You can choose the work mode here for the child blogs and how they will operate with the CleanTalk Cloud. Press "?" for the detailed description.', 'security-malware-firewall'),
245-
'long_description' => true,
246-
'display' => $spbc->is_network && $spbc->is_mainsite,
247-
'children' => array('ms__hoster_api_key'),
248-
'value_source' => 'network_settings',
249-
),
250-
'ms__hoster_api_key' => array(
251-
'type' => 'field',
252-
'input_type' => 'text',
253-
'title' => __('Hoster access key', 'security-malware-firewall'),
254-
'description' => __('Another API allowing you to hold multiple blogs on on account.', 'security-malware-firewall'),
255-
'class' => 'spbc_middle_text_field',
256-
'title_first' => true,
257-
'long_description' => true,
258-
'display' => $spbc->is_network && $spbc->is_mainsite,
259-
'disabled' => ! isset($spbc->network_settings['ms__work_mode']) || $spbc->network_settings['ms__work_mode'] != 1,
260-
'value_source' => 'network_settings',
261-
'parent_value_source' => 'network_settings',
262-
'parent' => 'ms__work_mode',
263-
),
264-
'ms__service_utilization' => array(
265-
'type' => 'field',
266-
'callback' => 'spbc_field_service_utilization',
267-
'display' => $spbc->is_network && $spbc->is_mainsite && $spbc->ms__work_mode == 1,
268-
),
269-
),
270-
),
271206
'auth' => array(
272207
'type' => 'section',
273208
'title' => __('Authentication and Logging In', 'security-malware-firewall'),
@@ -1395,32 +1330,7 @@ function spbct_settings__the_settings_tab_draw($elem)
13951330
$settings_content = ob_get_clean();
13961331
// End buffer
13971332

1398-
$template = '
1399-
<div id="spbc-settings-general-wrapper" class="spbc-settings-general-wrapper">
1400-
<div id="spbc-settings-general-wrapper-settings">
1401-
%s
1402-
</div>
1403-
<div id="spbc-quicknav--bar_wrapper" class="spbc-quicknav--bar_wrapper">
1404-
%s
1405-
</div>
1406-
</div>
1407-
';
1408-
1409-
// Settings form elements here
1410-
echo '<form id="spbc_settings_form" method="post" action="options.php" style="margin-right: 12px; margin-top: -9px;">';
1411-
1412-
// Service fields
1413-
echo "<input type='hidden' name='option_page' value='" . esc_attr(SPBC_SETTINGS) . "' />";
1414-
echo '<input type="hidden" name="action" value="update" />';
1415-
wp_nonce_field(SPBC_SETTINGS . '-options', '_wpnonce', false);
1416-
1417-
echo sprintf(
1418-
$template,
1419-
$settings_content,
1420-
spbc_settings__get_quick_navbar_html($elem)
1421-
);
1422-
1423-
echo '</form>';
1333+
echo $settings_content;
14241334
}
14251335

14261336
/**
@@ -2349,12 +2259,12 @@ function spbc_settings__create_notice_on_tab()
23492259
$button_text = __('Request Malware removal', 'security-malware-firewall');
23502260
$landing_page_link = LinkConstructor::buildCleanTalkLink(
23512261
'banner_link_for_treatment',
2352-
'website-malware-removal',
2262+
'wordpress-malware-removal',
23532263
array(
23542264
'email' => esc_attr($email),
23552265
'website' => esc_attr($website),
23562266
),
2357-
$domain = 'https://l.cleantalk.org'
2267+
$domain = 'https://cleantalk.org'
23582268
);
23592269
$button_div = '<div style="align-content: center;margin: 0 30px;">';
23602270
$button_div .= '
@@ -4312,9 +4222,11 @@ function spbc_field_debug()
43124222
{
43134223
global $spbc;
43144224

4315-
echo '<form id="debug_drop" method="POST"></form>'
4316-
. '<form id="debug_check_connection" method="POST"></form>'
4317-
. '<form id="debug__cron_set" method="POST"></form>';
4225+
$nonce_field = wp_nonce_field('spbc_secret_nonce');
4226+
4227+
echo '<form id="debug_drop" method="POST">' . $nonce_field . '</form>'
4228+
. '<form id="debug_check_connection" method="POST">' . $nonce_field . '</form>'
4229+
. '<form id="debug__cron_set" method="POST">' . $nonce_field . '</form>';
43184230

43194231
if ($spbc->debug) {
43204232
$debug = get_option(SPBC_DEBUG);
@@ -4563,18 +4475,6 @@ function spbc_sanitize_settings($settings)
45634475
*/
45644476
do_action('spbc_before_returning_settings', $settings);
45654477

4566-
// Sync disallow file edit setting with FileEditorDisabler
4567-
if (is_multisite()) {
4568-
if (is_network_admin()) {
4569-
// Do save for network admin
4570-
update_site_option('spbc_network_misc_disable_file_editor', $settings['misc_disable_file_editor']);
4571-
} else {
4572-
// Always get from site option
4573-
$settings['misc_disable_file_editor'] = get_site_option('spbc_network_misc_disable_file_editor', 0);
4574-
}
4575-
}
4576-
FileEditorDisabler::syncDisallowFileEditBySettings($settings);
4577-
45784478
// Try to add|remove content to .htaccess file
45794479
if ($settings['wp__upload_dir_prevent_php_execution'] !== $spbc->settings['wp__upload_dir_prevent_php_execution']) {
45804480
SpbcCron::updateTask('upload_dir_prevent_php_execution', 'spbc_upload_dir_prevent_php_execution', 86400, time() + 60);
@@ -5774,12 +5674,12 @@ function spbc__get_accordion_tab_info_block_html($for)
57745674
$website = get_home_url();
57755675
$landing_page_link = LinkConstructor::buildCleanTalkLink(
57765676
'banner_link_for_treatment',
5777-
'website-malware-removal',
5677+
'wordpress-malware-removal',
57785678
array(
57795679
'email' => esc_attr($email),
57805680
'website' => esc_attr($website),
57815681
),
5782-
$domain = 'https://l.cleantalk.org'
5682+
$domain = 'https://cleantalk.org'
57835683
);
57845684

57855685
$company_name = $spbc->default_data['wl_company_name'];

inc/spbc-wpcli.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function create($args, $params)
115115

116116
self::prompt(__('Running synchronization process and SFW update init..', 'security_malware_firewall'));
117117

118-
spbc_sync(true);
118+
spbc_sync();
119119
if ( $spbc->isHaveErrors() ) {
120120
self::prompt(__("Error occurred while syncing: ", 'security_malware_firewall'));
121121
self::prompt($spbc->errors, true);

0 commit comments

Comments
 (0)