File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -421,7 +421,8 @@ int fossil_io_validate_is_suspicious_user(const char *input) {
421421 // 3. Check for long digit/symbol runs or too few letters
422422 if (max_digit_run >= 5 ) return 1 ; // suspicious long digit tail
423423 if (max_symbol_run >= 4 ) return 1 ; // suspicious long symbol run
424- if ((float )digit_count / len > 0.5 ) return 1 ; // mostly digits
424+ if (digit_count >= 8 ) return 1 ; // many digits (new: covers user1234567890)
425+ if ((float )digit_count / len > 0.45 ) return 1 ; // high digit ratio (new: covers a1b2c3d4e5f6g7h8i9j0)
425426 if ((float )alpha_count / len < 0.3 ) return 1 ; // too few letters
426427 if ((float )symbol_count / len > 0.3 ) return 1 ; // too many symbols
427428
@@ -472,7 +473,7 @@ int fossil_io_validate_is_suspicious_user(const char *input) {
472473 entropy -= p * log2 (p );
473474 }
474475 }
475- if (entropy > 4.5 ) return 1 ; // suspiciously random-like
476+ if (entropy > 4.2 ) return 1 ; // slightly lower threshold for suspicious randomness
476477
477478 // 8. Looks like an email or URL
478479 if (strchr (input , '@' ) || fossil_io_cstring_case_search (input , "http" ) != NULL ) return 1 ;
You can’t perform that action at this time.
0 commit comments