SP v4 alpha2 sessions ?

Scott Cantor scott at restingparrotsoftware.com
Sat Sep 19 15:55:57 UTC 2026


> I didn't think this fully, why try to win complicated race condition
> between close(f) and ofstream open when php has full access to
> directory (create session files etc.).

Correct. That's why this isn't a particularly safe mechanism, but I probably will add an option to encrypt the data. Unfortunately that means Hub round trips every time a request hits a new process.

> php (and other cgi) really needs to run as different user than apache
> and/or use systemd sandboxing to prevent access to cacheDirectory.
> (systemd InaccessiblePaths=your_cache_dir_here).

Yes.

> I think boost has boost::iostreams::file_descriptor_sink/source to use
> open fd. But don't think it's needed if attacker/bad script has write
> access to cacheDirectory then symlinks are not main concern.


Nope.

> There's a small window:
> f=open(O_CREAT|O_EXCL...);
> close(f);
> // small window between close and ofstream where another process can
> remove file / symlink it to another file.
> ofstream os(path);


Of course, but again you can do that any time, you don't have to win that race condition.

> Is the cookie based mechanism going to use memory as cache and call to
> hub only when needed ?

Yes, to decrypt. Same as would be required if I encrypted the files.

-- Scott



More information about the users mailing list