Changeset 3063866
- Timestamp:
- 04/03/2024 03:18:19 PM (21 months ago)
- Location:
- wordfence-login-security
- Files:
-
- 42 added
- 42 deleted
- 12 edited
- 1 copied
-
tags/1.1.11 (copied) (copied from wordfence-login-security/trunk)
-
tags/1.1.11/classes/controller/captcha.php (modified) (1 diff)
-
tags/1.1.11/classes/controller/users.php (modified) (2 diffs)
-
tags/1.1.11/classes/controller/wordfencels.php (modified) (1 diff)
-
tags/1.1.11/css/admin-global.1710170444.css (deleted)
-
tags/1.1.11/css/admin-global.1712157269.css (added)
-
tags/1.1.11/css/admin.1710170444.css (deleted)
-
tags/1.1.11/css/admin.1712157269.css (added)
-
tags/1.1.11/css/colorbox.1710170444.css (deleted)
-
tags/1.1.11/css/colorbox.1712157269.css (added)
-
tags/1.1.11/css/embedded.1710170444.css (deleted)
-
tags/1.1.11/css/embedded.1712157269.css (added)
-
tags/1.1.11/css/font-awesome.1710170444.css (deleted)
-
tags/1.1.11/css/font-awesome.1712157269.css (added)
-
tags/1.1.11/css/ionicons.1710170444.css (deleted)
-
tags/1.1.11/css/ionicons.1712157269.css (added)
-
tags/1.1.11/css/jquery-ui.min.1710170444.css (deleted)
-
tags/1.1.11/css/jquery-ui.min.1712157269.css (added)
-
tags/1.1.11/css/jquery-ui.structure.min.1710170444.css (deleted)
-
tags/1.1.11/css/jquery-ui.structure.min.1712157269.css (added)
-
tags/1.1.11/css/jquery-ui.theme.min.1710170444.css (deleted)
-
tags/1.1.11/css/jquery-ui.theme.min.1712157269.css (added)
-
tags/1.1.11/css/login.1710170444.css (deleted)
-
tags/1.1.11/css/login.1712157269.css (added)
-
tags/1.1.11/css/wfselect2.min.1710170444.css (deleted)
-
tags/1.1.11/css/wfselect2.min.1712157269.css (added)
-
tags/1.1.11/css/woocommerce-account.1710170444.css (deleted)
-
tags/1.1.11/css/woocommerce-account.1712157269.css (added)
-
tags/1.1.11/js/admin-global.1710170444.js (deleted)
-
tags/1.1.11/js/admin-global.1712157269.js (added)
-
tags/1.1.11/js/admin.1710170444.js (deleted)
-
tags/1.1.11/js/admin.1712157269.js (added)
-
tags/1.1.11/js/chart.umd.1710170444.js (deleted)
-
tags/1.1.11/js/chart.umd.1712157269.js (added)
-
tags/1.1.11/js/jquery.colorbox.1710170444.js (deleted)
-
tags/1.1.11/js/jquery.colorbox.1712157269.js (added)
-
tags/1.1.11/js/jquery.colorbox.min.1710170444.js (deleted)
-
tags/1.1.11/js/jquery.colorbox.min.1712157269.js (added)
-
tags/1.1.11/js/jquery.qrcode.min.1710170444.js (deleted)
-
tags/1.1.11/js/jquery.qrcode.min.1712157269.js (added)
-
tags/1.1.11/js/jquery.tmpl.min.1710170444.js (deleted)
-
tags/1.1.11/js/jquery.tmpl.min.1712157269.js (added)
-
tags/1.1.11/js/login.1710170444.js (deleted)
-
tags/1.1.11/js/login.1712157269.js (added)
-
tags/1.1.11/js/wfselect2.min.1710170444.js (deleted)
-
tags/1.1.11/js/wfselect2.min.1712157269.js (added)
-
tags/1.1.11/languages/wordfence-login-security.pot (modified) (7 diffs)
-
tags/1.1.11/readme.txt (modified) (2 diffs)
-
tags/1.1.11/wordfence-login-security.php (modified) (2 diffs)
-
trunk/classes/controller/captcha.php (modified) (1 diff)
-
trunk/classes/controller/users.php (modified) (2 diffs)
-
trunk/classes/controller/wordfencels.php (modified) (1 diff)
-
trunk/css/admin-global.1710170444.css (deleted)
-
trunk/css/admin-global.1712157269.css (added)
-
trunk/css/admin.1710170444.css (deleted)
-
trunk/css/admin.1712157269.css (added)
-
trunk/css/colorbox.1710170444.css (deleted)
-
trunk/css/colorbox.1712157269.css (added)
-
trunk/css/embedded.1710170444.css (deleted)
-
trunk/css/embedded.1712157269.css (added)
-
trunk/css/font-awesome.1710170444.css (deleted)
-
trunk/css/font-awesome.1712157269.css (added)
-
trunk/css/ionicons.1710170444.css (deleted)
-
trunk/css/ionicons.1712157269.css (added)
-
trunk/css/jquery-ui.min.1710170444.css (deleted)
-
trunk/css/jquery-ui.min.1712157269.css (added)
-
trunk/css/jquery-ui.structure.min.1710170444.css (deleted)
-
trunk/css/jquery-ui.structure.min.1712157269.css (added)
-
trunk/css/jquery-ui.theme.min.1710170444.css (deleted)
-
trunk/css/jquery-ui.theme.min.1712157269.css (added)
-
trunk/css/login.1710170444.css (deleted)
-
trunk/css/login.1712157269.css (added)
-
trunk/css/wfselect2.min.1710170444.css (deleted)
-
trunk/css/wfselect2.min.1712157269.css (added)
-
trunk/css/woocommerce-account.1710170444.css (deleted)
-
trunk/css/woocommerce-account.1712157269.css (added)
-
trunk/js/admin-global.1710170444.js (deleted)
-
trunk/js/admin-global.1712157269.js (added)
-
trunk/js/admin.1710170444.js (deleted)
-
trunk/js/admin.1712157269.js (added)
-
trunk/js/chart.umd.1710170444.js (deleted)
-
trunk/js/chart.umd.1712157269.js (added)
-
trunk/js/jquery.colorbox.1710170444.js (deleted)
-
trunk/js/jquery.colorbox.1712157269.js (added)
-
trunk/js/jquery.colorbox.min.1710170444.js (deleted)
-
trunk/js/jquery.colorbox.min.1712157269.js (added)
-
trunk/js/jquery.qrcode.min.1710170444.js (deleted)
-
trunk/js/jquery.qrcode.min.1712157269.js (added)
-
trunk/js/jquery.tmpl.min.1710170444.js (deleted)
-
trunk/js/jquery.tmpl.min.1712157269.js (added)
-
trunk/js/login.1710170444.js (deleted)
-
trunk/js/login.1712157269.js (added)
-
trunk/js/wfselect2.min.1710170444.js (deleted)
-
trunk/js/wfselect2.min.1712157269.js (added)
-
trunk/languages/wordfence-login-security.pot (modified) (7 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/wordfence-login-security.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordfence-login-security/tags/1.1.11/classes/controller/captcha.php
r3049221 r3063866 99 99 $jsonResponse = wp_remote_retrieve_body($response); 100 100 $decoded = @json_decode($jsonResponse, true); 101 if (is_array($decoded) && isset($decoded['success']) && isset($decoded['score']) && isset($decoded['action'])) { 102 if ($decoded['success'] && $decoded['action'] == $action) { 103 return (float) $decoded['score']; 101 if (is_array($decoded) && isset($decoded['success'])) { 102 if ($decoded['success']) { 103 if (isset($decoded['score']) && isset($decoded['action']) && $decoded['action'] == $action) { 104 return (float) $decoded['score']; 105 } 104 106 } 105 107 return false; -
wordfence-login-security/tags/1.1.11/classes/controller/users.php
r3049221 r3063866 15 15 const META_KEY_ALLOW_GRACE_PERIOD = 'wfls-allow-grace-period'; 16 16 const META_KEY_VERIFICATION_TOKENS = 'wfls-verification-tokens'; 17 const META_KEY_CAPTCHA_SCORES = 'wfls-captcha-scores'; 17 18 const VERIFICATION_TOKEN_BYTES = 64; 18 19 const VERIFICATION_TOKEN_LIMIT = 5; //Max number of concurrent tokens 19 20 const VERIFICATION_TOKEN_TRANSIENT_PREFIX = 'wfls_verify_'; 21 const CAPTCHA_SCORE_LIMIT = 2; //Max number of captcha scores cached 22 const CAPTCHA_SCORE_TRANSIENT_PREFIX = 'wfls_captcha_'; 23 const CAPTCHA_SCORE_CACHE_DURATION = 60; //seconds 20 24 const LARGE_USER_BASE_THRESHOLD = 1000; 21 25 const TRUNCATED_ROLE_KEY = 1; … … 949 953 return $userId !== null && ($user === null || $userId === $user->ID); 950 954 } 955 956 /** 957 * Returns the key used to store a captcha score transient. 958 * 959 * @param string $hash 960 * @return string 961 */ 962 private function get_captcha_score_transient_key($hash) { 963 return self::CAPTCHA_SCORE_TRANSIENT_PREFIX . $hash; 964 } 965 966 /** 967 * Attempts to look up a stored captcha score for the given hash and user. If found, returns the score. If not, 968 * returns null. 969 * 970 * @param string $hash 971 * @param \WP_User $user 972 * @return float|false 973 */ 974 private function load_captcha_score($hash, $user) { 975 $key = $this->get_captcha_score_transient_key($hash); 976 $data = get_transient($key); 977 if ($data === false) { 978 return false; 979 } 980 981 if (!$user->exists() || $data['user'] !== $user->ID) { 982 return false; 983 } 984 985 return floatval($data['score']); 986 } 987 988 /** 989 * Deletes the stored captcha score if present for the given hash. 990 * 991 * @param string $hash 992 */ 993 private function clear_captcha_score($token, $user) { 994 $hash = $this->hash_captcha_token($token); 995 $key = $this->get_captcha_score_transient_key($hash); 996 delete_transient($key); 997 998 $storedHashes = get_user_meta($user->ID, self::META_KEY_CAPTCHA_SCORES, true); 999 $validHashes = array(); 1000 if (is_array($storedHashes)) { 1001 foreach ($storedHashes as $hash) { 1002 $storedScore = $this->load_captcha_score($hash, $user); 1003 if ($storedScore !== false) { 1004 $validHashes[] = $hash; 1005 } 1006 } 1007 } 1008 $validHashes = array_slice($validHashes, 0, self::CAPTCHA_SCORE_LIMIT); 1009 update_user_meta($user->ID, self::META_KEY_CAPTCHA_SCORES, $validHashes); 1010 } 1011 1012 /** 1013 * Hashes the captcha token for storage. 1014 * 1015 * @param string $token 1016 * @return string 1017 */ 1018 private function hash_captcha_token($token) { 1019 return wp_hash($token); 1020 } 1021 1022 /** 1023 * Returns the cached score for the given captcha score and user if available. This action removes it from the cache 1024 * since the intent is for it only to be used for the initial login request to validate credentials + the follow-up 1025 * request either finalizing the login (no 2FA set) or with the 2FA token. 1026 * 1027 * $expired will be set to `true` if the reason for returning `false` is because the $token is recently expired. It 1028 * will be false when the $token is either uncached or has been expired long enough to be removed from the internal 1029 * list. 1030 * 1031 * @param string $token 1032 * @param \WP_User $user 1033 * @param bool $expired 1034 * @return float|false 1035 */ 1036 public function cached_captcha_score($token, $user, &$expired = false) { 1037 $hash = $this->hash_captcha_token($token); 1038 $score = $this->load_captcha_score($hash, $user); 1039 if ($score === false) { 1040 $storedHashes = get_user_meta($user->ID, self::META_KEY_CAPTCHA_SCORES, true); 1041 if (is_array($storedHashes)) { 1042 $expired = in_array($hash, $storedHashes); 1043 } 1044 } 1045 1046 $this->clear_captcha_score($token, $user); 1047 return $score; 1048 } 1049 1050 /** 1051 * Caches the $token/$score pair for $user, automatically pruning its cached list to the maximum allowable count 1052 * 1053 * @param string $token 1054 * @param float|false $score 1055 * @param \WP_User $user 1056 */ 1057 public function cache_captcha_score($token, $score, $user) { 1058 if ($score === false) { 1059 return; 1060 } 1061 1062 $storedHashes = get_user_meta($user->ID, self::META_KEY_CAPTCHA_SCORES, true); 1063 $validHashes = array(); 1064 if (is_array($storedHashes)) { 1065 foreach ($storedHashes as $hash) { 1066 $storedScore = $this->load_captcha_score($hash, $user); 1067 if ($storedScore !== false) { 1068 $validHashes[] = $hash; 1069 } 1070 } 1071 } 1072 1073 $hash = $this->hash_verification_token($token); 1074 array_unshift($validHashes, $hash); 1075 while (count($validHashes) > self::CAPTCHA_SCORE_LIMIT) { 1076 $excessHash = array_pop($validHashes); 1077 delete_transient($this->get_captcha_score_transient_key($excessHash)); 1078 } 1079 1080 $key = $this->get_captcha_score_transient_key($hash); 1081 set_transient($key, array('user' => $user->ID, 'score' => $score), self::CAPTCHA_SCORE_CACHE_DURATION); 1082 update_user_meta($user->ID, self::META_KEY_CAPTCHA_SCORES, $validHashes); 1083 } 951 1084 952 1085 public function get_user_count() { -
wordfence-login-security/tags/1.1.11/classes/controller/wordfencels.php
r3049221 r3063866 636 636 $score = false; 637 637 if ($requireCAPTCHA && !$performVerification) { 638 $score = Controller_CAPTCHA::shared()->score($token); 638 $expired = false; 639 if (is_object($user) && $user instanceof \WP_User) { 640 $score = Controller_Users::shared()->cached_captcha_score($token, $user, $expired); 641 } 642 643 if ($score === false) { 644 if ($expired) { 645 return new \WP_Error('wfls_captcha_expired', wp_kses(__('<strong>CAPTCHA EXPIRED</strong>: The CAPTCHA verification for this login attempt has expired. Please try again.', 'wordfence-login-security'), array('strong'=>array()))); 646 } 647 648 $score = Controller_CAPTCHA::shared()->score($token); 649 650 if ($score !== false && is_object($user) && $user instanceof \WP_User) { 651 Controller_Users::shared()->cache_captcha_score($token, $score, $user); 652 Controller_Users::shared()->record_captcha_score($user, $score); 653 } 654 } 655 639 656 if ($score === false && !Controller_CAPTCHA::shared()->test_mode()) { //An invalid token will require additional verification (if test mode is not active) 640 657 $performVerification = true; 641 }642 else if (is_object($user) && $user instanceof \WP_User) {643 Controller_Users::shared()->record_captcha_score($user, $score);644 658 } 645 659 } -
wordfence-login-security/tags/1.1.11/languages/wordfence-login-security.pot
r3049221 r3063866 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Wordfence Login Security 1.1.1 0\n"6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wordfence-login-security-zip- Cjy0sfiYR\n"5 "Project-Id-Version: Wordfence Login Security 1.1.11\n" 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wordfence-login-security-zip-eZqOVC21Q\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 8 8 "Language-Team: LANGUAGE <[email protected]>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2024-0 3-11T15:20:44+00:00\n"12 "POT-Creation-Date: 2024-04-03T15:14:29+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.7.1\n" … … 265 265 msgstr "" 266 266 267 #: classes/controller/users.php:5 17267 #: classes/controller/users.php:521 268 268 #: classes/controller/wordfencels.php:486 269 269 msgid "2FA Status" 270 270 msgstr "" 271 271 272 #: classes/controller/users.php:52 1272 #: classes/controller/users.php:525 273 273 msgid "Last Login" 274 274 msgstr "" 275 275 276 #: classes/controller/users.php:52 3276 #: classes/controller/users.php:527 277 277 msgid "Last CAPTCHA" 278 278 msgstr "" 279 279 280 #: classes/controller/users.php:53 3280 #: classes/controller/users.php:537 281 281 msgid "Not Allowed" 282 282 msgstr "" 283 283 284 #: classes/controller/users.php:5 38284 #: classes/controller/users.php:542 285 285 #: classes/controller/wordfencels.php:490 286 286 msgid "Active" 287 287 msgstr "" 288 288 289 #: classes/controller/users.php:54 1289 #: classes/controller/users.php:545 290 290 msgid "Inactive<small class=\"wfls-sub-status\">(Grace Period)</small>" 291 291 msgstr "" 292 292 293 #: classes/controller/users.php:54 4293 #: classes/controller/users.php:548 294 294 msgid "Locked Out<small class=\"wfls-sub-status\">(Grace Period Disabled)</small>" 295 295 msgstr "" 296 296 297 #: classes/controller/users.php:54 4297 #: classes/controller/users.php:548 298 298 msgid "Locked Out<small class=\"wfls-sub-status\">(Grace Period Exceeded)</small>" 299 299 msgstr "" 300 300 301 #: classes/controller/users.php:5 47301 #: classes/controller/users.php:551 302 302 #: classes/controller/wordfencels.php:490 303 303 msgid "Inactive" 304 304 msgstr "" 305 305 306 #: classes/controller/users.php:56 0306 #: classes/controller/users.php:564 307 307 msgid "(not required)" 308 308 msgstr "" 309 309 310 #: classes/controller/users.php:65 4310 #: classes/controller/users.php:658 311 311 msgid "Edit two-factor authentication for %s" 312 312 msgstr "" 313 313 314 #: classes/controller/users.php:65 4314 #: classes/controller/users.php:658 315 315 #: views/settings/options.php:9 316 316 msgid "2FA" 317 317 msgstr "" 318 318 319 #: classes/controller/users.php:66 5319 #: classes/controller/users.php:669 320 320 #: views/settings/user-stats.php:25 321 321 msgid "2FA Active" 322 322 msgstr "" 323 323 324 #: classes/controller/users.php:6 66324 #: classes/controller/users.php:670 325 325 #: views/settings/user-stats.php:26 326 326 msgid "2FA Inactive" … … 442 442 443 443 #: classes/controller/wordfencels.php:490 444 #: classes/controller/wordfencels.php:8 55444 #: classes/controller/wordfencels.php:869 445 445 #: views/manage/grace-period.php:22 446 446 msgid "Locked Out" … … 500 500 msgstr "" 501 501 502 #: classes/controller/wordfencels.php:671 502 #: classes/controller/wordfencels.php:645 503 msgid "<strong>CAPTCHA EXPIRED</strong>: The CAPTCHA verification for this login attempt has expired. Please try again." 504 msgstr "" 505 506 #: classes/controller/wordfencels.php:685 503 507 msgid "Login Verification Required" 504 508 msgstr "" 505 509 506 #: classes/controller/wordfencels.php:6 76510 #: classes/controller/wordfencels.php:690 507 511 msgid "<strong>VERIFICATION REQUIRED</strong>: Additional verification is required for login. If there is a valid account for the provided login credentials, please check the email address associated with it for a verification link to continue logging in." 508 512 msgstr "" 509 513 510 #: classes/controller/wordfencels.php: 692514 #: classes/controller/wordfencels.php:706 511 515 msgid "<strong>CODE INVALID</strong>: The 2FA code provided is either expired or invalid. Please try again." 512 516 msgstr "" 513 517 514 #: classes/controller/wordfencels.php:7 01518 #: classes/controller/wordfencels.php:715 515 519 msgid "<strong>CODE REQUIRED</strong>: Please enter your 2FA code immediately after your password in the same field." 516 520 msgstr "" 517 521 518 #: classes/controller/wordfencels.php:7 03522 #: classes/controller/wordfencels.php:717 519 523 msgid "<strong>CODE REQUIRED</strong>: Please provide your 2FA code when prompted." 520 524 msgstr "" 521 525 522 #: classes/controller/wordfencels.php:7 06526 #: classes/controller/wordfencels.php:720 523 527 msgid "<strong>LOGIN BLOCKED</strong>: 2FA is required to be active on your account. Please contact the site administrator." 524 528 msgstr "" 525 529 526 #: classes/controller/wordfencels.php:7 09530 #: classes/controller/wordfencels.php:723 527 531 msgid "You do not currently have two-factor authentication active on your account, which will be required beginning %s. <a href=\"%s\">Configure 2FA</a>" 528 532 msgstr "" 529 533 530 #: classes/controller/wordfencels.php:7 59534 #: classes/controller/wordfencels.php:773 531 535 msgid "Email verification succeeded. Please continue logging in." 532 536 msgstr "" 533 537 534 #: classes/controller/wordfencels.php:7 62538 #: classes/controller/wordfencels.php:776 535 539 msgid "Email verification invalid or expired. Please try again." 536 540 msgstr "" 537 541 538 #: classes/controller/wordfencels.php:8 16539 #: classes/controller/wordfencels.php:8 19542 #: classes/controller/wordfencels.php:830 543 #: classes/controller/wordfencels.php:833 540 544 msgid "Login Security" 541 545 msgstr "" 542 546 543 #: classes/controller/wordfencels.php:8 47547 #: classes/controller/wordfencels.php:861 544 548 #: views/settings/options.php:23 545 549 #: views/settings/user-stats.php:33 … … 547 551 msgstr "" 548 552 549 #: classes/controller/wordfencels.php:8 51553 #: classes/controller/wordfencels.php:865 550 554 #: views/manage/grace-period.php:22 551 555 #: views/options/option-roles.php:57 … … 553 557 msgstr "" 554 558 555 #: classes/controller/wordfencels.php:8 70559 #: classes/controller/wordfencels.php:884 556 560 msgid "Users without 2FA active (%s)" 557 561 msgstr "" 558 562 559 #: classes/controller/wordfencels.php: 888560 #: classes/controller/wordfencels.php: 889563 #: classes/controller/wordfencels.php:902 564 #: classes/controller/wordfencels.php:903 561 565 msgid "Two-Factor Authentication" 562 566 msgstr "" 563 567 564 #: classes/controller/wordfencels.php: 889568 #: classes/controller/wordfencels.php:903 565 569 msgid "Learn more<span class=\"wfls-hidden-xs\"> about Two-Factor Authentication</span>" 566 570 msgstr "" 567 571 568 #: classes/controller/wordfencels.php: 898572 #: classes/controller/wordfencels.php:912 569 573 msgid "Settings" 570 574 msgstr "" 571 575 572 #: classes/controller/wordfencels.php: 899576 #: classes/controller/wordfencels.php:913 573 577 msgid "Login Security Settings" 574 578 msgstr "" 575 579 576 #: classes/controller/wordfencels.php: 899580 #: classes/controller/wordfencels.php:913 577 581 msgid "Learn more<span class=\"wfls-hidden-xs\"> about Login Security</span>" 578 582 msgstr "" 579 583 580 #: classes/controller/wordfencels.php:9 25584 #: classes/controller/wordfencels.php:939 581 585 msgid "<strong>REGISTRATION ATTEMPT BLOCKED</strong>: This site requires a security token created when the page loads for all registration attempts. Please ensure JavaScript is enabled and try again." 582 586 msgstr "" 583 587 584 #: classes/controller/wordfencels.php:9 32588 #: classes/controller/wordfencels.php:946 585 589 msgid "<strong>REGISTRATION ATTEMPT BLOCKED</strong>: The security token for the login attempt was invalid or expired. Please reload the page and try again." 586 590 msgstr "" 587 591 588 #: classes/controller/wordfencels.php:9 45592 #: classes/controller/wordfencels.php:959 589 593 msgid "<strong>REGISTRATION BLOCKED</strong>: The registration request was blocked because it was flagged as spam. Please try again or <a href=\"#\" class=\"wfls-registration-captcha-contact\" data-token=\"%s\">contact the site owner</a> for help." 590 594 msgstr "" 591 595 592 #: classes/controller/wordfencels.php:9 48596 #: classes/controller/wordfencels.php:962 593 597 msgid "<strong>REGISTRATION BLOCKED</strong>: The registration request was blocked because it was flagged as spam. Please try again or contact the site owner for help." 594 598 msgstr "" 595 599 596 #: classes/controller/wordfencels.php:10 18600 #: classes/controller/wordfencels.php:1032 597 601 msgid "Wordfence 2FA" 598 602 msgstr "" -
wordfence-login-security/tags/1.1.11/readme.txt
r3056304 r3063866 5 5 Requires PHP: 5.5 6 6 Tested up to: 6.5 7 Stable tag: 1.1.1 07 Stable tag: 1.1.11 8 8 9 9 Secure your website with Wordfence Login Security, providing two-factor authentication, login and registration CAPTCHA, and XML-RPC protection. … … 58 58 59 59 == Changelog == 60 61 = 1.1.11 - April 3, 2024 = 62 * Fix: Revised the behavior of the reCAPTCHA verification to use the documented expiration period of the token and response to avoid sending verification requests too frequently, which could artificially lower scores in some circumstances 60 63 61 64 = 1.1.10 - March 11, 2024 = -
wordfence-login-security/tags/1.1.11/wordfence-login-security.php
r3049221 r3063866 5 5 Author: Wordfence 6 6 Author URI: https://www.wordfence.com/ 7 Version: 1.1.1 07 Version: 1.1.11 8 8 Network: true 9 9 Requires at least: 4.5 … … 39 39 define('WORDFENCE_LS_FROM_CORE', ($wfCoreActive && isset($wfCoreLoading) && $wfCoreLoading)); 40 40 41 define('WORDFENCE_LS_VERSION', '1.1.1 0');42 define('WORDFENCE_LS_BUILD_NUMBER', '171 0170444');41 define('WORDFENCE_LS_VERSION', '1.1.11'); 42 define('WORDFENCE_LS_BUILD_NUMBER', '1712157269'); 43 43 44 44 define('WORDFENCE_LS_PLUGIN_BASENAME', plugin_basename(__FILE__)); -
wordfence-login-security/trunk/classes/controller/captcha.php
r3049221 r3063866 99 99 $jsonResponse = wp_remote_retrieve_body($response); 100 100 $decoded = @json_decode($jsonResponse, true); 101 if (is_array($decoded) && isset($decoded['success']) && isset($decoded['score']) && isset($decoded['action'])) { 102 if ($decoded['success'] && $decoded['action'] == $action) { 103 return (float) $decoded['score']; 101 if (is_array($decoded) && isset($decoded['success'])) { 102 if ($decoded['success']) { 103 if (isset($decoded['score']) && isset($decoded['action']) && $decoded['action'] == $action) { 104 return (float) $decoded['score']; 105 } 104 106 } 105 107 return false; -
wordfence-login-security/trunk/classes/controller/users.php
r3049221 r3063866 15 15 const META_KEY_ALLOW_GRACE_PERIOD = 'wfls-allow-grace-period'; 16 16 const META_KEY_VERIFICATION_TOKENS = 'wfls-verification-tokens'; 17 const META_KEY_CAPTCHA_SCORES = 'wfls-captcha-scores'; 17 18 const VERIFICATION_TOKEN_BYTES = 64; 18 19 const VERIFICATION_TOKEN_LIMIT = 5; //Max number of concurrent tokens 19 20 const VERIFICATION_TOKEN_TRANSIENT_PREFIX = 'wfls_verify_'; 21 const CAPTCHA_SCORE_LIMIT = 2; //Max number of captcha scores cached 22 const CAPTCHA_SCORE_TRANSIENT_PREFIX = 'wfls_captcha_'; 23 const CAPTCHA_SCORE_CACHE_DURATION = 60; //seconds 20 24 const LARGE_USER_BASE_THRESHOLD = 1000; 21 25 const TRUNCATED_ROLE_KEY = 1; … … 949 953 return $userId !== null && ($user === null || $userId === $user->ID); 950 954 } 955 956 /** 957 * Returns the key used to store a captcha score transient. 958 * 959 * @param string $hash 960 * @return string 961 */ 962 private function get_captcha_score_transient_key($hash) { 963 return self::CAPTCHA_SCORE_TRANSIENT_PREFIX . $hash; 964 } 965 966 /** 967 * Attempts to look up a stored captcha score for the given hash and user. If found, returns the score. If not, 968 * returns null. 969 * 970 * @param string $hash 971 * @param \WP_User $user 972 * @return float|false 973 */ 974 private function load_captcha_score($hash, $user) { 975 $key = $this->get_captcha_score_transient_key($hash); 976 $data = get_transient($key); 977 if ($data === false) { 978 return false; 979 } 980 981 if (!$user->exists() || $data['user'] !== $user->ID) { 982 return false; 983 } 984 985 return floatval($data['score']); 986 } 987 988 /** 989 * Deletes the stored captcha score if present for the given hash. 990 * 991 * @param string $hash 992 */ 993 private function clear_captcha_score($token, $user) { 994 $hash = $this->hash_captcha_token($token); 995 $key = $this->get_captcha_score_transient_key($hash); 996 delete_transient($key); 997 998 $storedHashes = get_user_meta($user->ID, self::META_KEY_CAPTCHA_SCORES, true); 999 $validHashes = array(); 1000 if (is_array($storedHashes)) { 1001 foreach ($storedHashes as $hash) { 1002 $storedScore = $this->load_captcha_score($hash, $user); 1003 if ($storedScore !== false) { 1004 $validHashes[] = $hash; 1005 } 1006 } 1007 } 1008 $validHashes = array_slice($validHashes, 0, self::CAPTCHA_SCORE_LIMIT); 1009 update_user_meta($user->ID, self::META_KEY_CAPTCHA_SCORES, $validHashes); 1010 } 1011 1012 /** 1013 * Hashes the captcha token for storage. 1014 * 1015 * @param string $token 1016 * @return string 1017 */ 1018 private function hash_captcha_token($token) { 1019 return wp_hash($token); 1020 } 1021 1022 /** 1023 * Returns the cached score for the given captcha score and user if available. This action removes it from the cache 1024 * since the intent is for it only to be used for the initial login request to validate credentials + the follow-up 1025 * request either finalizing the login (no 2FA set) or with the 2FA token. 1026 * 1027 * $expired will be set to `true` if the reason for returning `false` is because the $token is recently expired. It 1028 * will be false when the $token is either uncached or has been expired long enough to be removed from the internal 1029 * list. 1030 * 1031 * @param string $token 1032 * @param \WP_User $user 1033 * @param bool $expired 1034 * @return float|false 1035 */ 1036 public function cached_captcha_score($token, $user, &$expired = false) { 1037 $hash = $this->hash_captcha_token($token); 1038 $score = $this->load_captcha_score($hash, $user); 1039 if ($score === false) { 1040 $storedHashes = get_user_meta($user->ID, self::META_KEY_CAPTCHA_SCORES, true); 1041 if (is_array($storedHashes)) { 1042 $expired = in_array($hash, $storedHashes); 1043 } 1044 } 1045 1046 $this->clear_captcha_score($token, $user); 1047 return $score; 1048 } 1049 1050 /** 1051 * Caches the $token/$score pair for $user, automatically pruning its cached list to the maximum allowable count 1052 * 1053 * @param string $token 1054 * @param float|false $score 1055 * @param \WP_User $user 1056 */ 1057 public function cache_captcha_score($token, $score, $user) { 1058 if ($score === false) { 1059 return; 1060 } 1061 1062 $storedHashes = get_user_meta($user->ID, self::META_KEY_CAPTCHA_SCORES, true); 1063 $validHashes = array(); 1064 if (is_array($storedHashes)) { 1065 foreach ($storedHashes as $hash) { 1066 $storedScore = $this->load_captcha_score($hash, $user); 1067 if ($storedScore !== false) { 1068 $validHashes[] = $hash; 1069 } 1070 } 1071 } 1072 1073 $hash = $this->hash_verification_token($token); 1074 array_unshift($validHashes, $hash); 1075 while (count($validHashes) > self::CAPTCHA_SCORE_LIMIT) { 1076 $excessHash = array_pop($validHashes); 1077 delete_transient($this->get_captcha_score_transient_key($excessHash)); 1078 } 1079 1080 $key = $this->get_captcha_score_transient_key($hash); 1081 set_transient($key, array('user' => $user->ID, 'score' => $score), self::CAPTCHA_SCORE_CACHE_DURATION); 1082 update_user_meta($user->ID, self::META_KEY_CAPTCHA_SCORES, $validHashes); 1083 } 951 1084 952 1085 public function get_user_count() { -
wordfence-login-security/trunk/classes/controller/wordfencels.php
r3049221 r3063866 636 636 $score = false; 637 637 if ($requireCAPTCHA && !$performVerification) { 638 $score = Controller_CAPTCHA::shared()->score($token); 638 $expired = false; 639 if (is_object($user) && $user instanceof \WP_User) { 640 $score = Controller_Users::shared()->cached_captcha_score($token, $user, $expired); 641 } 642 643 if ($score === false) { 644 if ($expired) { 645 return new \WP_Error('wfls_captcha_expired', wp_kses(__('<strong>CAPTCHA EXPIRED</strong>: The CAPTCHA verification for this login attempt has expired. Please try again.', 'wordfence-login-security'), array('strong'=>array()))); 646 } 647 648 $score = Controller_CAPTCHA::shared()->score($token); 649 650 if ($score !== false && is_object($user) && $user instanceof \WP_User) { 651 Controller_Users::shared()->cache_captcha_score($token, $score, $user); 652 Controller_Users::shared()->record_captcha_score($user, $score); 653 } 654 } 655 639 656 if ($score === false && !Controller_CAPTCHA::shared()->test_mode()) { //An invalid token will require additional verification (if test mode is not active) 640 657 $performVerification = true; 641 }642 else if (is_object($user) && $user instanceof \WP_User) {643 Controller_Users::shared()->record_captcha_score($user, $score);644 658 } 645 659 } -
wordfence-login-security/trunk/languages/wordfence-login-security.pot
r3049221 r3063866 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Wordfence Login Security 1.1.1 0\n"6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wordfence-login-security-zip- Cjy0sfiYR\n"5 "Project-Id-Version: Wordfence Login Security 1.1.11\n" 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wordfence-login-security-zip-eZqOVC21Q\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 8 8 "Language-Team: LANGUAGE <[email protected]>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2024-0 3-11T15:20:44+00:00\n"12 "POT-Creation-Date: 2024-04-03T15:14:29+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.7.1\n" … … 265 265 msgstr "" 266 266 267 #: classes/controller/users.php:5 17267 #: classes/controller/users.php:521 268 268 #: classes/controller/wordfencels.php:486 269 269 msgid "2FA Status" 270 270 msgstr "" 271 271 272 #: classes/controller/users.php:52 1272 #: classes/controller/users.php:525 273 273 msgid "Last Login" 274 274 msgstr "" 275 275 276 #: classes/controller/users.php:52 3276 #: classes/controller/users.php:527 277 277 msgid "Last CAPTCHA" 278 278 msgstr "" 279 279 280 #: classes/controller/users.php:53 3280 #: classes/controller/users.php:537 281 281 msgid "Not Allowed" 282 282 msgstr "" 283 283 284 #: classes/controller/users.php:5 38284 #: classes/controller/users.php:542 285 285 #: classes/controller/wordfencels.php:490 286 286 msgid "Active" 287 287 msgstr "" 288 288 289 #: classes/controller/users.php:54 1289 #: classes/controller/users.php:545 290 290 msgid "Inactive<small class=\"wfls-sub-status\">(Grace Period)</small>" 291 291 msgstr "" 292 292 293 #: classes/controller/users.php:54 4293 #: classes/controller/users.php:548 294 294 msgid "Locked Out<small class=\"wfls-sub-status\">(Grace Period Disabled)</small>" 295 295 msgstr "" 296 296 297 #: classes/controller/users.php:54 4297 #: classes/controller/users.php:548 298 298 msgid "Locked Out<small class=\"wfls-sub-status\">(Grace Period Exceeded)</small>" 299 299 msgstr "" 300 300 301 #: classes/controller/users.php:5 47301 #: classes/controller/users.php:551 302 302 #: classes/controller/wordfencels.php:490 303 303 msgid "Inactive" 304 304 msgstr "" 305 305 306 #: classes/controller/users.php:56 0306 #: classes/controller/users.php:564 307 307 msgid "(not required)" 308 308 msgstr "" 309 309 310 #: classes/controller/users.php:65 4310 #: classes/controller/users.php:658 311 311 msgid "Edit two-factor authentication for %s" 312 312 msgstr "" 313 313 314 #: classes/controller/users.php:65 4314 #: classes/controller/users.php:658 315 315 #: views/settings/options.php:9 316 316 msgid "2FA" 317 317 msgstr "" 318 318 319 #: classes/controller/users.php:66 5319 #: classes/controller/users.php:669 320 320 #: views/settings/user-stats.php:25 321 321 msgid "2FA Active" 322 322 msgstr "" 323 323 324 #: classes/controller/users.php:6 66324 #: classes/controller/users.php:670 325 325 #: views/settings/user-stats.php:26 326 326 msgid "2FA Inactive" … … 442 442 443 443 #: classes/controller/wordfencels.php:490 444 #: classes/controller/wordfencels.php:8 55444 #: classes/controller/wordfencels.php:869 445 445 #: views/manage/grace-period.php:22 446 446 msgid "Locked Out" … … 500 500 msgstr "" 501 501 502 #: classes/controller/wordfencels.php:671 502 #: classes/controller/wordfencels.php:645 503 msgid "<strong>CAPTCHA EXPIRED</strong>: The CAPTCHA verification for this login attempt has expired. Please try again." 504 msgstr "" 505 506 #: classes/controller/wordfencels.php:685 503 507 msgid "Login Verification Required" 504 508 msgstr "" 505 509 506 #: classes/controller/wordfencels.php:6 76510 #: classes/controller/wordfencels.php:690 507 511 msgid "<strong>VERIFICATION REQUIRED</strong>: Additional verification is required for login. If there is a valid account for the provided login credentials, please check the email address associated with it for a verification link to continue logging in." 508 512 msgstr "" 509 513 510 #: classes/controller/wordfencels.php: 692514 #: classes/controller/wordfencels.php:706 511 515 msgid "<strong>CODE INVALID</strong>: The 2FA code provided is either expired or invalid. Please try again." 512 516 msgstr "" 513 517 514 #: classes/controller/wordfencels.php:7 01518 #: classes/controller/wordfencels.php:715 515 519 msgid "<strong>CODE REQUIRED</strong>: Please enter your 2FA code immediately after your password in the same field." 516 520 msgstr "" 517 521 518 #: classes/controller/wordfencels.php:7 03522 #: classes/controller/wordfencels.php:717 519 523 msgid "<strong>CODE REQUIRED</strong>: Please provide your 2FA code when prompted." 520 524 msgstr "" 521 525 522 #: classes/controller/wordfencels.php:7 06526 #: classes/controller/wordfencels.php:720 523 527 msgid "<strong>LOGIN BLOCKED</strong>: 2FA is required to be active on your account. Please contact the site administrator." 524 528 msgstr "" 525 529 526 #: classes/controller/wordfencels.php:7 09530 #: classes/controller/wordfencels.php:723 527 531 msgid "You do not currently have two-factor authentication active on your account, which will be required beginning %s. <a href=\"%s\">Configure 2FA</a>" 528 532 msgstr "" 529 533 530 #: classes/controller/wordfencels.php:7 59534 #: classes/controller/wordfencels.php:773 531 535 msgid "Email verification succeeded. Please continue logging in." 532 536 msgstr "" 533 537 534 #: classes/controller/wordfencels.php:7 62538 #: classes/controller/wordfencels.php:776 535 539 msgid "Email verification invalid or expired. Please try again." 536 540 msgstr "" 537 541 538 #: classes/controller/wordfencels.php:8 16539 #: classes/controller/wordfencels.php:8 19542 #: classes/controller/wordfencels.php:830 543 #: classes/controller/wordfencels.php:833 540 544 msgid "Login Security" 541 545 msgstr "" 542 546 543 #: classes/controller/wordfencels.php:8 47547 #: classes/controller/wordfencels.php:861 544 548 #: views/settings/options.php:23 545 549 #: views/settings/user-stats.php:33 … … 547 551 msgstr "" 548 552 549 #: classes/controller/wordfencels.php:8 51553 #: classes/controller/wordfencels.php:865 550 554 #: views/manage/grace-period.php:22 551 555 #: views/options/option-roles.php:57 … … 553 557 msgstr "" 554 558 555 #: classes/controller/wordfencels.php:8 70559 #: classes/controller/wordfencels.php:884 556 560 msgid "Users without 2FA active (%s)" 557 561 msgstr "" 558 562 559 #: classes/controller/wordfencels.php: 888560 #: classes/controller/wordfencels.php: 889563 #: classes/controller/wordfencels.php:902 564 #: classes/controller/wordfencels.php:903 561 565 msgid "Two-Factor Authentication" 562 566 msgstr "" 563 567 564 #: classes/controller/wordfencels.php: 889568 #: classes/controller/wordfencels.php:903 565 569 msgid "Learn more<span class=\"wfls-hidden-xs\"> about Two-Factor Authentication</span>" 566 570 msgstr "" 567 571 568 #: classes/controller/wordfencels.php: 898572 #: classes/controller/wordfencels.php:912 569 573 msgid "Settings" 570 574 msgstr "" 571 575 572 #: classes/controller/wordfencels.php: 899576 #: classes/controller/wordfencels.php:913 573 577 msgid "Login Security Settings" 574 578 msgstr "" 575 579 576 #: classes/controller/wordfencels.php: 899580 #: classes/controller/wordfencels.php:913 577 581 msgid "Learn more<span class=\"wfls-hidden-xs\"> about Login Security</span>" 578 582 msgstr "" 579 583 580 #: classes/controller/wordfencels.php:9 25584 #: classes/controller/wordfencels.php:939 581 585 msgid "<strong>REGISTRATION ATTEMPT BLOCKED</strong>: This site requires a security token created when the page loads for all registration attempts. Please ensure JavaScript is enabled and try again." 582 586 msgstr "" 583 587 584 #: classes/controller/wordfencels.php:9 32588 #: classes/controller/wordfencels.php:946 585 589 msgid "<strong>REGISTRATION ATTEMPT BLOCKED</strong>: The security token for the login attempt was invalid or expired. Please reload the page and try again." 586 590 msgstr "" 587 591 588 #: classes/controller/wordfencels.php:9 45592 #: classes/controller/wordfencels.php:959 589 593 msgid "<strong>REGISTRATION BLOCKED</strong>: The registration request was blocked because it was flagged as spam. Please try again or <a href=\"#\" class=\"wfls-registration-captcha-contact\" data-token=\"%s\">contact the site owner</a> for help." 590 594 msgstr "" 591 595 592 #: classes/controller/wordfencels.php:9 48596 #: classes/controller/wordfencels.php:962 593 597 msgid "<strong>REGISTRATION BLOCKED</strong>: The registration request was blocked because it was flagged as spam. Please try again or contact the site owner for help." 594 598 msgstr "" 595 599 596 #: classes/controller/wordfencels.php:10 18600 #: classes/controller/wordfencels.php:1032 597 601 msgid "Wordfence 2FA" 598 602 msgstr "" -
wordfence-login-security/trunk/readme.txt
r3056304 r3063866 58 58 59 59 == Changelog == 60 61 = 1.1.11 - April 3, 2024 = 62 * Fix: Revised the behavior of the reCAPTCHA verification to use the documented expiration period of the token and response to avoid sending verification requests too frequently, which could artificially lower scores in some circumstances 60 63 61 64 = 1.1.10 - March 11, 2024 = -
wordfence-login-security/trunk/wordfence-login-security.php
r3049221 r3063866 5 5 Author: Wordfence 6 6 Author URI: https://www.wordfence.com/ 7 Version: 1.1.1 07 Version: 1.1.11 8 8 Network: true 9 9 Requires at least: 4.5 … … 39 39 define('WORDFENCE_LS_FROM_CORE', ($wfCoreActive && isset($wfCoreLoading) && $wfCoreLoading)); 40 40 41 define('WORDFENCE_LS_VERSION', '1.1.1 0');42 define('WORDFENCE_LS_BUILD_NUMBER', '171 0170444');41 define('WORDFENCE_LS_VERSION', '1.1.11'); 42 define('WORDFENCE_LS_BUILD_NUMBER', '1712157269'); 43 43 44 44 define('WORDFENCE_LS_PLUGIN_BASENAME', plugin_basename(__FILE__));
Note: See TracChangeset
for help on using the changeset viewer.