diff --git a/build/build.xml b/build/build.xml index 2358b0e2e2..aa1f00f40f 100644 --- a/build/build.xml +++ b/build/build.xml @@ -3,7 +3,7 @@ - + diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index c22bdb49bf..5df3f977e4 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -50,6 +50,7 @@
  1. Changelog
      +
    • Changes since 3.3.5-RC1
    • Changes since 3.3.4
    • Changes since 3.3.4-RC1
    • Changes since 3.3.3
    • @@ -157,6 +158,16 @@
      +

      Changes since 3.3.5-RC1

      +

      Bug

      +
        +
      • [PHPBB3-16878] - Error in password_hash() with ARGON2 + Sodium & threadcount > 1
      • +
      +

      Hardening

      +
        +
      • [SECURITY-254] - Disallow whitespace characters that might be invisible
      • +
      +

      Changes since 3.3.4

      Bug

        diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 44855e62b6..9dd005de47 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1751,7 +1751,8 @@ function validate_username($username, $allowed_username = false, $allow_all_name } // ... fast checks first. - if (strpos($username, '"') !== false || strpos($username, '"') !== false || empty($clean_username)) + if (strpos($username, '"') !== false || strpos($username, '"') !== false || empty($clean_username) + || preg_match('/[\x{180E}\x{2005}-\x{200D}\x{202F}\x{205F}\x{2060}\x{FEFF}]/u', $username)) { return 'INVALID_CHARS'; } diff --git a/phpBB/phpbb/db/migration/data/v33x/v335.php b/phpBB/phpbb/db/migration/data/v33x/v335.php new file mode 100644 index 0000000000..bea7e15d8d --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v33x/v335.php @@ -0,0 +1,36 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v33x; + +class v335 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.3.5', '>='); + } + + public static function depends_on() + { + return [ + '\phpbb\db\migration\data\v33x\v335rc1', + ]; + } + + public function update_data() + { + return [ + ['config.update', ['version', '3.3.5']], + ]; + } +} diff --git a/tests/functions/validate_username_test.php b/tests/functions/validate_username_test.php index 2ff8bb4e46..fc52f91347 100644 --- a/tests/functions/validate_username_test.php +++ b/tests/functions/validate_username_test.php @@ -51,6 +51,7 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case 'barfoo_disallow' => array('USERNAME_DISALLOWED'), 'admin_taken' => array('USERNAME_TAKEN'), 'group_taken' => array('USERNAME_TAKEN'), + 'a d m i n i ᠎strator' => array('INVALID_CHARS'), )), array('USERNAME_ALPHA_ONLY', array( 'foobar_allow' => array(), @@ -65,6 +66,7 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case 'barfoo_disallow' => array('USERNAME_DISALLOWED'), 'admin_taken' => array('USERNAME_TAKEN'), 'group_taken' => array('INVALID_CHARS'), + 'a d m i n i ᠎strator' => array('INVALID_CHARS'), )), array('USERNAME_ALPHA_SPACERS', array( 'foobar_allow' => array(), @@ -79,6 +81,7 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case 'barfoo_disallow' => array('USERNAME_DISALLOWED'), 'admin_taken' => array('USERNAME_TAKEN'), 'group_taken' => array('USERNAME_TAKEN'), + 'a d m i n i ᠎strator' => array('INVALID_CHARS'), )), array('USERNAME_LETTER_NUM', array( 'foobar_allow' => array(), @@ -93,6 +96,7 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case 'barfoo_disallow' => array('USERNAME_DISALLOWED'), 'admin_taken' => array('USERNAME_TAKEN'), 'group_taken' => array('INVALID_CHARS'), + 'a d m i n i ᠎strator' => array('INVALID_CHARS'), )), array('USERNAME_LETTER_NUM_SPACERS', array( 'foobar_allow' => array(), @@ -107,6 +111,7 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case 'barfoo_disallow' => array('USERNAME_DISALLOWED'), 'admin_taken' => array('USERNAME_TAKEN'), 'group_taken' => array('USERNAME_TAKEN'), + 'a d m i n i ᠎strator' => array('INVALID_CHARS'), )), array('USERNAME_ASCII', array( 'foobar_allow' => array(), @@ -121,6 +126,7 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case 'barfoo_disallow' => array('USERNAME_DISALLOWED'), 'admin_taken' => array('USERNAME_TAKEN'), 'group_taken' => array('USERNAME_TAKEN'), + 'a d m i n i ᠎strator' => array('INVALID_CHARS'), )), ); } @@ -201,6 +207,11 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case 'foobar_group', array('username'), ), + 'a d m i n i ᠎strator' => array( + $expected['a d m i n i ᠎strator'], + 'a d m i n i ᠎strator', + array('username'), + ), )); } }