Last modified: 2014-05-29 12:33:29 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67891, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65891 - Session cookies (and data) being shared between web services cause issues
Session cookies (and data) being shared between web services cause issues
Status: ASSIGNED
Product: Wikimedia Labs
Classification: Unclassified
tools (Other open bugs)
unspecified
All All
: High major
: ---
Assigned To: Marc A. Pelletier
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-29 11:58 UTC by Marc A. Pelletier
Modified: 2014-05-29 12:33 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Marc A. Pelletier 2014-05-29 11:58:37 UTC
As the session id cookie is identical between tools, the first one to save a session prevents others from doing so because of permissions.  If the permissions allowed it, it would - at best - cause sessions overwriting each other and at worst leak information and possibly authentication tokens between tools.

Fixing this requires either

(a) per-tool session.cookie_path so that every tool maintains distinct sessions or
(b) per-tool session.save_path so that every tool maintains separate session /data/
Comment 1 Marc A. Pelletier 2014-05-29 12:13:04 UTC
Note: one possibility is to simply *document* that caveat and let tools that care about/intend to use session data to set their save_path or cookie_path accordingly.
Comment 2 Krinkle 2014-05-29 12:22:37 UTC
(In reply to Marc A. Pelletier from comment #0)
> As the session id cookie is identical between tools, the first one to save a
> session (..)

Note that the reason they share the same session id to the outside is because of session.name (defaults to PHPSESSID). When PHP wants to start/continue a session, it sees that cookie is set already on the client and thus doesn't set a new one.

We should not modify session.name per tool though, as that would just create loads of cookies. And while modifying cookie.path also creates a session cookie per tool, at least only one is sent back and forth between each request (the one for the current path), whereas with session.name the browser would be forced to send *all* cookies with every HTTP request.

We already have individual webservices running per tool with their own configuration and user process, probably easiest to ensure the php backend for that sets cookie path to something like ~/.phpsessions (instead of the global /var/lib/php5 directory)
Comment 3 Marc A. Pelletier 2014-05-29 12:33:29 UTC
On the other hand, any change to the PHP config should be changing the /defaults/ only, allowing tools designed to do so to share session data as needed.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links