diff --git a/checkov/secrets/plugins/custom_regex_detector.py b/checkov/secrets/plugins/custom_regex_detector.py index a8359d810d2..10a8f3e78a5 100644 --- a/checkov/secrets/plugins/custom_regex_detector.py +++ b/checkov/secrets/plugins/custom_regex_detector.py @@ -142,6 +142,9 @@ def _find_potential_secret( current_regex_to_metadata: dict[str, dict[str, Any]] = self.multiline_regex_to_metadata if is_multiline else self.regex_to_metadata kwargs["regex_denylist"] = current_denylist for match, regex in self.analyze_string(string_to_analyze, **kwargs): + if len(match) == 0: + # Skip empty matches + continue try: verified_result = call_function_with_arguments(self.verify, secret=match, context=context) is_verified = True if verified_result == VerifiedResult.VERIFIED_TRUE else False