Skip to content

Commit 14bf483

Browse files
committed
Refspam module update.
1 parent f8ea5a6 commit 14bf483

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

modules/modules.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ PHPMailer:
4242
Referrer spam module:
4343
Name: "Referrer spam module"
4444
False Positive Risk: "Medium"
45-
Version: "2026.76.0"
45+
Version: "2026.227.0"
4646
Dependencies:
4747
intl: "*"
4848
Files:
4949
modules/refspam.php:
5050
From: "https://raw.githubusercontent.com/CIDRAM/CIDRAM-Extras/master/modules/refspam.php"
51-
Checksum: "fcd2a6afffa780194f8f02326be936f165aa7287cca0b26c92ea5cbdf6df7ace:12499"
51+
Checksum: "faed9eb5b86fcdd9dd64471b9484efeefdefbcfae0ceb3b80a7621f456bfec90:12963"
5252
Used with: "modules"

modules/refspam.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: Referrer spam module (last modified: 2026.03.18).
11+
* This file: Referrer spam module (last modified: 2026.08.16).
1212
*
1313
* False positive risk (an approximate, rough estimate only): « [ ]Low [x]Medium [ ]High »
1414
*/
@@ -202,9 +202,16 @@
202202
], $this->BlockInfo['IPAddr']);
203203
} // 2023.06.16
204204

205-
if ($this->trigger(\preg_match('~//blog//wp-login\.php$~i', $this->BlockInfo['Referrer']), 'Hack attempt via referrer header injection detected')) {
206-
$this->Reporter->report([10, 15, 21], ['Hack attempt via referrer header injection detected.'], $this->BlockInfo['IPAddr']);
207-
} // 2025.07.24
205+
if ($this->BlockInfo['rURI'] !== '' && ($PDPos = \strpos($this->BlockInfo['rURI'], '://')) !== false) {
206+
$SPos = \strpos(\substr($this->BlockInfo['rURI'], $PDPos + 3), '/');
207+
$Auth = $SPos === false ? $this->BlockInfo['rURI'] : \substr($this->BlockInfo['rURI'], 0, $SPos + $PDPos + 3);
208+
$AuthLen = \strlen($Auth);
209+
if ($Auth !== \substr($this->BlockInfo['Referrer'], 0, $AuthLen)) {
210+
if ($this->trigger(\preg_match('~//wp-login\.php$~i', $this->BlockInfo['Referrer']), 'Hack attempt via referrer header injection detected')) {
211+
$this->Reporter->report([10, 15, 21], ['Hack attempt via referrer header injection detected.'], $this->BlockInfo['IPAddr']);
212+
} // 2025.07.24 mod 2026.08.16
213+
}
214+
}
208215

209216
$this->trigger($RefLC === '(null)', 'Illegal referrer'); // 2018.03.13
210217
};

0 commit comments

Comments
 (0)