Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible unescaped special chars in session name and bug after PHP patch #79699 #34

Open
rarog opened this issue Oct 15, 2020 · 2 comments

Comments

@rarog
Copy link
Contributor

rarog commented Oct 15, 2020

Bug Report

Q A
Version(s) 2.9.3

Summary

After the patch https://bugs.php.net/bug.php?id=79699 certain session names are buggy and won't work anymore.

Current behavior

The generated cookie name doesn't necessarily match the internal session name which is a problem after the php patch.

How to reproduce

  1. Install the latest PHP featuring above bugfix.
  2. Set up the session for example like this:
    'session_config' => [
        'name' => 'my:session',
    ],
  1. The generated cookie name is my%3Asession but the module still expects to get a cookie for my:session, which it won't get with the security patch.

Expected behavior

Special characters like : should also be escaped during initalisation, so the cookie name and session name match.

@rarog
Copy link
Contributor Author

rarog commented Oct 15, 2020

According to https://curl.haxx.se/rfc/cookie_spec.html the escaped or forbidden characters should be :, ,, (whitespace) and probably =

@thisispiers
Copy link

\Laminas\Session\SessionManager::setName() throws an exception for non-alphanumeric characters in the session name. See

'Name provided contains invalid characters; must be alphanumeric only'

This issue can marked as closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants