Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

--- 3.2 ---

* security: Identify remote webseer servers by their real connection address, not a forwarded header

* issue: Correct issue with enable/disable service checks and servers

* issue: Correct issues with page refresh
Expand Down
13 changes: 4 additions & 9 deletions remote.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,10 @@
include_once($config['base_path'] . '/lib/functions.php');
include_once($config['base_path'] . '/plugins/webseer/includes/functions.php');

if (isset($_SERVER['X-Forwarded-For'])) {
$remoteip = $_SERVER['X-Forwarded-For'];
} elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$remoteip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} elseif (isset($_SERVER['REMOTE_ADDR'])) {
$remoteip = $_SERVER['REMOTE_ADDR'];
} else {
$remoteip = '127.0.0.1';
}
// Identify the peer by its real connection address. A forwarded header is set
// by the client and must not be trusted to authorize the server-to-server
// actions below.
$remoteip = $_SERVER['REMOTE_ADDR'] ?? '127.0.0.1';

$servers = db_fetch_assoc('SELECT * FROM plugin_webseer_servers');

Expand Down