diff --git a/docs/changes.txt b/docs/changes.txt index 2188e59ac..663ce2bf0 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -11,6 +11,7 @@ ## Bugs ## +- Fixed integer overflow for large masks in -a 6 attack mode - Fixed alias detection with additional processor core count check - Fixed maximum password length in modules of hash-modes 600, 7800, 7801 and 9900 - Fixed non-zero status code when using --stdout diff --git a/src/mpsp.c b/src/mpsp.c index 2ab211833..96f82c65b 100644 --- a/src/mpsp.c +++ b/src/mpsp.c @@ -1261,6 +1261,16 @@ int mask_ctx_update_loop (hashcat_ctx_t *hashcat_ctx) return -1; } + // do not allow modifier count > 32 bit + // https://github.com/hashcat/hashcat/issues/2482 + + if (combinator_ctx->combs_cnt > 0xffffffff) + { + event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of mask: %s", mask_ctx->mask); + + return -1; + } + if (backend_session_update_mp (hashcat_ctx) == -1) return -1; } }