Commit Graph

295 Commits

Author SHA1 Message Date
Michal Čihař
c44f5ab080 Always use UTC time in HTTP headers
Using timezones in this context can cause problem when DST changes
apply.

Also this can be information leak of server timezone.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-18 17:07:00 +02:00
Michal Čihař
01b9db6b1c Rename getCookiePath() to getRootPath()
It is not used only for cookies, so generic name makes more sense.

Issue #12374

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-17 15:35:15 +02:00
Michal Čihař
311be7515c Use https when available
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-17 13:17:41 +02:00
Michal Čihař
99492bf42a Merge branch 'QA_4_6' into QA_4_6-security 2016-07-26 16:29:07 +02:00
Michal Čihař
6c95b73f90 Do not append session IDs to all URLs in redirect
There is no need to do that as we rely on session cookies anyway. Also
appending sesson ID to external URLs is not a good idea.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-26 16:20:04 +02:00
Michal Čihař
3ba8a026fc Use hash_hmac for MAC rather than plain SHA1
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-18 16:56:52 +02:00
Michal Čihař
67d6eeac42 Improve URL filtering in url.php
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-18 16:39:25 +02:00
Michal Čihař
ba072e42dc Validate serialized data before unserializing
We need only strings, integers or arrays, so there is no need to
unserialize strings containing any complex types.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-12 16:29:11 +02:00
Michal Čihař
767195e197 Sanitize MySQL host name before connecting
It can contain p: prefix which we don't want to honor.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-12 15:14:57 +02:00
Michal Čihař
660e3a177f Remove debugging code
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-11 09:33:13 +02:00
Michal Čihař
27caf5b46b Improve detection of script name
In case PHP_SELF was not set by server, we used REQUEST_URI, which might
embed PATH_INFO as well. However we really need to know the path without
it, so let's strip it as well.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-06-16 09:35:56 +02:00
Michal Čihař
9e0a321551 Canonicalize redirect URL
We provide absolute path now to avoid problems with URLs like
/phpmyadmin/index.php/.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-06-15 11:42:45 +02:00
Michal Čihař
cf97a33ffb Ignore args in the debug backtrace
This heavily reduces memory usage and also avoids potential information
leak.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-05-23 12:01:02 +02:00
Michal Čihař
5fc8020c5b Ensure links from setup go through url.php
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-05-23 09:40:17 +02:00
Michal Čihař
0982a6a424 Better laben Percona
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-05-17 10:39:33 +02:00
Michal Čihař
b25d847b3b Remove not used oubbound URLs
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-05-17 10:38:58 +02:00
Michal Čihař
d248d8d83d Remove link to no longer maintained blog
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-05-17 10:35:56 +02:00
Michal Čihař
521b79d0d7 Replace non working pbxt link with link to MariaDB knowledgebase
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-05-17 10:34:52 +02:00
Michal Čihař
02c7df74bf Add mariadb.com domain to whitelist
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-05-17 10:33:53 +02:00
Michal Čihař
3771852471 Use https when linking to php.net
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-05-17 10:10:13 +02:00
Michal Čihař
59e56bd63a Pass link to demo server through url.php
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-29 15:36:54 +02:00
Michal Čihař
8326aaebe5 Pass links to external sites in changelog through url.php
This avoids possible information disclossure in the links (token).

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-29 15:35:02 +02:00
Michal Čihař
02aa0729dc Make PMA_fatalError work even early
The messaging framework can not make assumptions about available objects
as this doesn't have to be satisfied in early PMA_fatalError case.

Issue #12056

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-03-01 15:36:05 +01:00
Michal Čihař
1bddcff0d5 Remove accidental comment
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-02-03 20:22:49 +01:00
Michal Čihař
c2b41b829a Wrap header() and headers_sent() in response
This allows us to test the code without using runkit. Currenly only
AuthenticationHttp is migrated to new code, but others will follow.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-02-03 19:49:05 +01:00
Michal Čihař
431450a237 Make test run even without runkit
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-02-03 19:49:05 +01:00
Michal Čihař
1e9e14d23b Remove ForceSSL configuration directive
In most setups we simply do not have enough information to decide
whether user has come through HTTPS or not leading to infinite
redirects.

Anyway this is better to handle at web server side together with setting
HSTS headers.

Issue #11412, #11883

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-02-03 14:20:11 +01:00
Michal Čihař
ed96969ff9 Merge branch 'QA_4_5' 2016-01-28 09:23:27 +01:00
Isaac Bennetch
1d6efadaea Fix merge conflicts
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2016-01-28 00:42:03 -05:00
Michal Čihař
7ffd8d69a1 Merge pull request #5 from phpmyadmin/hash_equals
Use hash_equals for comparing token
2016-01-26 09:55:05 +01:00
Michal Čihař
0a24f92d08 Set correct content type for JSON responses
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-01-19 08:32:34 +01:00
Michal Čihař
ec0e88e37e Use hash_equals for comparing token
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-01-19 08:32:07 +01:00
Marc Delisle
2f3360993f Fix merge conflict
Signed-off-by: Marc Delisle <marc@infomarc.info>
2016-01-16 08:30:37 -05:00
Marc Delisle
7d4c570b76 Undefined index: is_ajax_request
Signed-off-by: Marc Delisle <marc@infomarc.info>
2016-01-16 08:27:11 -05:00
Michal Čihař
39771f44c0 Simplify code
For ages we set $GLOBALS['lang'] to language code, so it's safe to use
it here.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-01-12 14:50:13 +01:00
Michal Čihař
eb37c77e97 PMA_sendHeaderLocation does not return anything
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-01-05 17:01:54 +01:00
Michal Čihař
55b317c699 Remove /*overload*/ prefix from mb_* calls
I believe this was temporary flagging to see which code is migrated and
can be safely removed now.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-01-04 16:35:28 +01:00
Michal Čihař
cc07b737dc Remove unused PMA_String class
The class is no longer used:

- the ctype part is not needed by new SQL parser
- the utf-8 manipulation was replaced by direct usage of mbstring

Signed-off-by: Michal Čihař <michal@cihar.com>
2015-12-21 12:09:06 +01:00
Hugues Peccatte
9f97786e9b Update PHPDoc.
Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
2015-12-11 22:22:21 +01:00
Michal Čihař
1deac94062 Move PHP extensions check to separate function
Issue #11731

Signed-off-by: Michal Čihař <michal@cihar.com>
2015-12-09 08:24:41 +01:00
Michal Čihař
c4cdd16342 Move PATH_INFO cleanup to function
Issue #11731

Signed-off-by: Michal Čihař <michal@cihar.com>
2015-12-09 08:22:03 +01:00
Michal Čihař
3565e4db79 Remove PMA_arrayMergeRecursive
It can be replaced with array_replace_recursive as of PHP 5.3, we
require PHP 5.5.

Signed-off-by: Michal Čihař <michal@cihar.com>
2015-12-09 08:06:00 +01:00
Michal Čihař
06bb1e67f2 Remove PMA_arrayWalkRecursive
For the single remaining use case native array_walk_recursive is good
enoug.

Signed-off-by: Michal Čihař <michal@cihar.com>
2015-12-09 07:42:13 +01:00
Hugues Peccatte
6f4676cdfc Merge remote-tracking branch 'origin/master' into useNamespaces_master 2015-10-04 18:04:49 +02:00
Marc Delisle
fd7c8522ea Clarify method name
Signed-off-by: Marc Delisle <marc@infomarc.info>
2015-10-03 10:14:29 -04:00
Hugues Peccatte
a5d35d41b6 Revert PMA_String rename.
Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
2015-09-14 22:39:03 +02:00
Hugues Peccatte
42c0ebac85 Merge branch 'master' into useNamespaces_master 2015-09-09 22:05:00 +02:00
Madhura Jayaratne
93bfdbe371 Remove more references to Drizzle
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
2015-09-10 01:06:58 +10:00
Hugues Peccatte
7f8f34e89d Remove classes require_once.
Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
2015-09-01 21:30:22 +02:00
Hugues Peccatte
0761fb1801 Rename classes files.
Rename classes.

Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
2015-09-01 21:30:21 +02:00