Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fix
Browse files Browse the repository at this point in the history
# Conflicts:
#	security-malware-firewall.php
  • Loading branch information
Glomberg committed Nov 1, 2024
2 parents 0177e0d + 9bce003 commit 2485e4a
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 174 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ psalm.xml
/lib/CleantalkSP/Common/Scanner/SignaturesAnalyser/.github/
/lib/CleantalkSP/Common/Scanner/HeuristicAnalyser/.github/
/lib/CleantalkSP/Common/Scanner/SignaturesAnalyser/composer.json
/lib/CleantalkSP/Common/Scanner/SignaturesAnalyser/README.md
/lib/CleantalkSP/Common/Scanner/HeuristicAnalyser/composer.json
/lib/CleantalkSP/Common/Scanner/HeuristicAnalyser/README.md
/lib/CleantalkSP/Common/Scanner/HeuristicAnalyser/Vendors/TiktokenPhp/composer.json
/lib/CleantalkSP/Common/Scanner/HeuristicAnalyser/Vendors/TiktokenPhp/README.md
/lib/CleantalkSP/Common/FSWatcher/Storage/data/
/lib/CleantalkSP/Common/FSWatcher/logs/
/lib/CleantalkSP/Common/Helpers/composer.json

25 changes: 0 additions & 25 deletions lib/CleantalkSP/Common/Helpers/composer.json

This file was deleted.

24 changes: 20 additions & 4 deletions lib/CleantalkSP/Common/RemoteCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class RemoteCalls
*/
protected $without_token;

protected static $allowedActionsWithoutToken = [
'post_api_key',
];

const COOLDOWN = 10;

/**
Expand All @@ -53,10 +57,20 @@ public static function checkWithoutToken()
{
global $spbc;

$rc_servers = [
'netserv3.cleantalk.org',
'netserv4.cleantalk.org',
];

return ! $spbc->key_is_ok &&
Request::get('spbc_remote_call_action') &&
in_array(Request::get('plugin_name'), array('security', 'spbc')) &&
strpos(IP::resolve(IP::get()), 'cleantalk.org') !== false;
in_array(IP::resolve(IP::get('remote_addr')), $rc_servers, true);
}

private static function isAllowedWithoutToken($rc)
{
return in_array($rc, self::$allowedActionsWithoutToken, true);
}

/**
Expand Down Expand Up @@ -87,9 +101,11 @@ public function process()
// Check API key
if (
($this->state->data['key_is_ok'] !== false) &&
(($token === strtolower(md5($this->state->api_key)) ||
$token === strtolower(hash('sha256', $this->state->api_key))) ||
$this->without_token)
(
( $token === strtolower(md5($this->state->api_key)) ||
$token === strtolower(hash('sha256', $this->state->api_key)) ) ||
( $this->without_token && self::isAllowedWithoutToken($action) )
)
) {
// Flag to let plugin know that Remote Call is running.
$this->state->rc_running = true;
Expand Down
32 changes: 0 additions & 32 deletions lib/CleantalkSP/Common/Scanner/HeuristicAnalyser/README.md

This file was deleted.

This file was deleted.

This file was deleted.

35 changes: 0 additions & 35 deletions lib/CleantalkSP/Common/Scanner/SignaturesAnalyser/README.md

This file was deleted.

5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: security, firewall, malware, wordpress security, brute force
Requires at least: 5.0
Tested up to: 6.6
Requires PHP: 5.6
Stable tag: 2.145
Stable tag: 2.145.1
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -336,6 +336,9 @@ This is required for the Security FireWall to function properly. Plugins that ar

== Changelog ==

= 2.145.1 Nov 01 2024
* Fix. Remote Calls. RC calling without token fixed. (#438)

= 2.145 Oct 28 2024
* Fix. Setting. React components i18n fixed.
* Fix. Code. Frontend malware scanner disabled by default.
Expand Down
2 changes: 1 addition & 1 deletion security-malware-firewall.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Plugin URI: https://wordpress.org/plugins/security-malware-firewall/
Description: Security & Malware scan by CleanTalk to protect your website from online threats and viruses. IP/Country FireWall, Web application FireWall. Detailed stats and logs to have full control.
Author: CleanTalk Security
Version: 2.145.1-fix
Version: 2.145.1
Author URI: https://cleantalk.org
Text Domain: security-malware-firewall
Domain Path: /i18n
Expand Down

0 comments on commit 2485e4a

Please sign in to comment.