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

Cookie “phpMyAdmin” will be soon rejected because it has the “sameSite” attribute set to “none” or an invalid value, without the “secure” attribute. #16981

Closed
williamdes opened this issue Jun 27, 2021 · 5 comments
Assignees
Labels
Bug A problem or regression with an existing feature hardening patch
Projects
Milestone

Comments

@williamdes
Copy link
Member

williamdes commented Jun 27, 2021

Describe the bug

Cookie “phpMyAdmin” will be soon rejected because it has the “sameSite” attribute set to “none” or an invalid value,
without the “secure” attribute.
To know more about the “sameSite“ attribute,
read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

Server configuration

  • phpMyAdmin version: 5.1

Client configuration

  • Browser: Waterfox latest
  • Operating system: Ubuntu
@williamdes williamdes added this to Needs triage in issues via automation Jun 27, 2021
@williamdes williamdes moved this from Needs triage to High priority in issues Jun 27, 2021
@williamdes williamdes added Bug A problem or regression with an existing feature patch labels Jun 27, 2021
@williamdes
Copy link
Member Author

williamdes commented Jun 27, 2021

Set-Cookie: phpMyAdmin=d2bbe0430dfa6ebb81ffe4fc985b4451; path=/@phpmyadmin/theREALphpMyAdminREPO/; HttpOnly

Should be fixed by this diff

diff --git a/libraries/classes/Session.php b/libraries/classes/Session.php
index f68bad2495..3d1290d881 100644
--- a/libraries/classes/Session.php
+++ b/libraries/classes/Session.php
@@ -180,6 +180,8 @@ class Session
         ini_set('session.use_strict_mode', '1');
         // make the session cookie HttpOnly
         ini_set('session.cookie_httponly', '1');
+        // add SameSite to the session cookie
+        ini_set('session.cookie_samesite', $config->get('CookieSameSite'));
         // do not force transparent session ids
         ini_set('session.use_trans_sid', '0');

https://www.php.net/manual/en/session.configuration.php#ini.session.cookie-samesite (Available as of PHP 7.3.0.)

phpMyAdmin=d2bbe0430dfa6ebb81ffe4fc985b4451; path=/@phpmyadmin/theREALphpMyAdminREPO/; HttpOnly; SameSite=Strict

@williamdes williamdes added this to the 5.1.2 milestone Jun 27, 2021
@MauricioFauth
Copy link
Member

Related to #16316.

@MauricioFauth
Copy link
Member

We have to make sure that it will work with PHP prior to version 7.3.0.

@williamdes
Copy link
Member Author

We have to make sure that it will work with PHP prior to version 7.3.0.

I am not sure to understand what you mean, but for sure we will need to restrict the usage to PHP >= 7.3 by an if

@MauricioFauth
Copy link
Member

I am not sure to understand what you mean, but for sure we will need to restrict the usage to PHP >= 7.3 by an if

That is what I meant.

@williamdes williamdes self-assigned this Jul 22, 2021
williamdes added a commit that referenced this issue Jul 22, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Jul 22, 2021
…rted by Psalm

Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from High priority to Closed Jul 22, 2021
MauricioFauth added a commit to MauricioFauth/phpmyadmin that referenced this issue Feb 15, 2022
- Related to phpmyadmin#16981

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature hardening patch
Projects
issues
  
Closed
Development

No branches or pull requests

2 participants