Commit Graph

98 Commits

Author SHA1 Message Date
Michal Čihař
1f819d8d50 Coding style improvements to #13011
- use camel case for function names
- move initialization to existing on load block

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-02-20 16:32:01 +01:00
Shreyas Sinha
c433b571b4
Pass Google reCAPTCHA with the submit button
Signed-off-by: Shreyas Sinha <shreyas.sinha14@gmail.com>
2017-02-20 11:12:34 +05:30
Michal Čihař
82f13e34d0 Better handle multiple open browser windows
Calculate session expiry per browser (tracking is based on
sessionStorage which is unique per tab). With this we're able to detect
that there is another window open and actively used and avoid logging it
out by inactive one.

Issue #11231

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-02-14 17:00:44 +01:00
Michal Čihař
924aabf652 Do not show language selector without choices
Move the check from template to the code, so that the selection is
completely hidden when there is nothing to select.

Fixes #12988

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-02-13 11:22:43 +01:00
Michal Čihař
1b7914a4e5 Remove connect_type setting
It is really not necessary as MySQL decides connection type rather based
on hostname than on anything else.

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-02-02 16:08:44 +01:00
Michal Čihař
5022ff9560 Do not show errors from OpenSSL cookie encryption/decryption
This can happen from corrupted cookies, by invalid encryption parameters
used in older phpMyAdmin versions or by wrong openSSL configuration.

In neither case the error is useful to user, but we need to clear the
error buffer as otherwise the errors would pop up later, for example
during MySQL SSL setup.

Fixes #12924

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-02-02 13:43:51 +01:00
Michal Čihař
fe39fbfe1a Merge branch 'QA_4_6' 2017-01-25 10:07:33 +01:00
Michal Čihař
31084a09f6 Improve error message for cookie encryption
- make it localized
- correctly report that it's about cookies

Issue #12924

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-01-25 10:07:19 +01:00
Michal Čihař
92aa487c54 Merge branch 'QA_4_6' 2016-12-20 14:44:03 +01:00
Michal Čihař
30cd5fc358 Use same encryption key with openssl and phpseclib
Issue #12293

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-20 14:38:34 +01:00
Michal Čihař
03bc52f6dc Correctly report OpenSSL errors from cookie encryption
Without calling openssl_error_string() we pollute openssl global state
and some other library might report this as failure (eg. mysqlnd driver
when connecting to SSL enabled server).

Fixes #12293

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-20 14:38:03 +01:00
Michal Čihař
b866371b9a Determine whether to use openssl just once
Issue #12293

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-20 14:30:51 +01:00
Michal Čihař
945e615253 Merge branch 'QA_4_6' 2016-12-19 15:23:31 +01:00
Michal Čihař
7d361806c3 Share code for rendering custom header and footer
Fixes #12802

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-19 15:20:12 +01:00
Isaac Bennetch
e3a4bfe757 Fix display of custom header and footer in certain edge cases.
Issues #12801 and #12802

Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2016-12-14 12:32:42 -05:00
Michal Čihař
3bd6d4c645 Merge branch 'QA_4_6' 2016-11-30 13:38:38 +01:00
Michal Čihař
05a258778f ReCaptcha now works without allow_url_fopen
Fixes #12588

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-30 13:37:46 +01:00
Michal Čihař
daae30499f Merge branch 'master' into master-security 2016-11-08 15:59:39 +01:00
Deven Bansod
e2dac31bdb Refactor the language selector display into a template
Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
2016-10-31 09:02:59 +05:30
Michal Čihař
5a1854c2b7 Merge branch 'QA_4_6-security' into master-security 2016-09-19 11:53:49 +02:00
Michal Čihař
fbad6b9b4d Verify value of access_time to avoid unwanted session extension
We need to ansure the access_time parameter is in valid range to avoid
possibility of remotely extending session validity.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-19 11:53:07 +02:00
Michal Čihař
19c24a8c6c Merge branch 'master' into master-security 2016-09-16 10:30:28 +02:00
Michal Čihař
3546bed47e Avoid using mb_strlen for checking whether string is empty
Using strlen produces same results here, just way faster.

Fixes #12397

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-16 10:29:21 +02:00
Michal Čihař
860ff02b07 Merge branch 'master' into master-security 2016-08-18 17:38:23 +02:00
Michal Čihař
ba82f0000c Merge branch 'QA_4_6' into QA_4_6-security 2016-08-18 17:38:15 +02:00
Michal Čihař
46b329c32b Merge branch 'QA_4_6' 2016-08-18 17:37:34 +02:00
Michal Čihař
6faa1fe46a Add rel="noopener noreferrer" to all external target="_blank" links
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-18 17:35:20 +02:00
Michal Čihař
9816dc66af Merge branch 'QA_4_6-security' into master-security 2016-08-18 09:50:57 +02:00
Michal Čihař
c83b2b0872 Use hash_equals for checking username
This makes the comparison happen in constant time and makes it
impossible to use it to guess stored usernames.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-18 09:41:21 +02:00
Michal Čihař
b2ea7205fb Merge branch 'QA_4_6-security' into master-security 2016-08-18 09:12:49 +02:00
Michal Čihař
9dbe520e90 Strip null bytes from MySQL username
In old PHP versions this could lead to allow/deny rules bypass.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-18 09:11:45 +02:00
Michal Čihař
1cd7b757bf Merge branch 'master' into master-security 2016-08-02 08:45:23 +02:00
Michal Čihař
493ece49ee Merge branch 'QA_4_6' into QA_4_6-security 2016-08-02 08:45:16 +02:00
Michal Čihař
696eeb463d Merge branch 'QA_4_6' 2016-08-02 08:43:22 +02:00
Michal Čihař
38b73180fd Fix password change in cookie auth
We can not set same cookie twice, so we have to avoid sending auth
cookie when we're about to change the password.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-02 08:42:44 +02:00
Michal Čihař
690202368b Merge branch 'QA_4_6-security' into master-security 2016-07-26 16:47:52 +02:00
Michal Čihař
cc9d0f128c Merge branch 'QA_4_6' into QA_4_6-security 2016-07-26 16:47:44 +02:00
Michal Čihař
e14c334d7a Merge branch 'QA_4_6' 2016-07-26 16:47:33 +02:00
Michal Čihař
16c4ca0daa Properly escape configuration parameters when rendering
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-26 16:47:01 +02:00
Michal Čihař
7de035439d Merge branch 'QA_4_6' 2016-07-22 16:42:58 +02:00
Michal Čihař
76e87c3e33 Do not use mb_strlen on data we know are bytes
Issue #12397

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-22 16:39:12 +02:00
Michal Čihař
f72572708f Merge branch 'QA_4_6-security' into master-security 2016-07-22 14:42:09 +02:00
Michal Čihař
024a924b38 Avoid calculating strlen twice
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-22 14:12:45 +02:00
Michal Čihař
9106b33933 Improve secrets splitting
- ensure it has 16 bytes
- extends it by copying content if original is too short
- correctly handle corner cases (eg. 1 byte secret)

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-22 14:10:28 +02:00
Michal Čihař
643681ee68 Use consistent iv and encrypted text concatenation as other libs
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-22 13:46:51 +02:00
Michal Čihař
2adf1ca83e Merge branch 'QA_4_6-security' into master-security 2016-07-22 11:35:14 +02:00
Michal Čihař
3ee65fc8bf Use MAC to verify IV as well
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-22 10:29:46 +02:00
Michal Čihař
ef03daf658 Remove hashing of blowfish secret
New code doesn't have problems with longer secrets.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-22 09:59:02 +02:00
Michal Čihař
d29df46b3a Do not generate too long session secret
We need 16+16 bytes, generating 256 is not really needed.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-22 09:58:39 +02:00
Michal Čihař
e2a25d773d Merge pmaServer and pmaPass cookies
This addresses several issues:

- makes server name encrypted and authenticated, so that it can not be
  tampered
- reduces cookie usage
- reduces overhead of encryption/authentication

The pmaUser cookie is still separate to avoid different lifetime
(pmaUser has month lifetime, while pmaAuth is session only by default).

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-22 09:47:32 +02:00