Project

General

Profile

Actions

Bug #17011

open

Cookies clash between different firewalls accessed via the same hostname

Added by Matthew Fearnley 2 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Web Interface
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Release Notes:
Default
Affected Plus Version:
26.03.1
Affected Architecture:
All

Description

If you have access to multiple firewalls on different port-forwards on a single hostname, then you can only log in to one at a time - they all set an identically named `PHPSESSID` cookie, causing it to keep the login session for the last firewall you logged into.

We could prevent clashes by setting php.ini to use a unique session name instead of `PHPSESSID`.

Perhaps something like this in /etc/rc.php_ini_setup:

session.name = SESSID_$(/sbin/sysctl -n kern.hostuuid | /sbin/sha256sum | /usr/bin/cut -d' ' -f1)

This should give a unique, unchanging value for each firewall, using the system UUID, hashing it to prevent it leaking the info.

(This is the best data I can think of to use. I considered openssl rand, but this would log people out if php-fpm restarts.
I also considered /var/db/uniqueid, set/used by system_get_uniqueid(), but it's not clear whether this would necessarily be set before the web interface first starts.)

No data to display

Actions

Also available in: Atom