From 0916eb02b32304d987464467dedc9ce534be311a Mon Sep 17 00:00:00 2001 From: dmiller Date: Tue, 26 May 2026 18:56:47 +0000 Subject: [PATCH] Tighten limits on PCRE matches --- service_scan.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service_scan.cc b/service_scan.cc index ec7ff2e48..60bfb36ae 100644 --- a/service_scan.cc +++ b/service_scan.cc @@ -457,13 +457,13 @@ void ServiceProbeMatch::InitMatch(const char *matchtext, int lineno) { } // Set some limits to avoid evil match cases. // These are flexible; if they cause problems, increase them. - pcre2_set_match_limit(match_context, 100000); + pcre2_set_match_limit(match_context, 50000); #ifdef pcre2_set_depth_limit // Changed name in PCRE2 10.30. PCRE2 uses macro definitions for function // names, so we don't have to add this to configure.ac. - pcre2_set_depth_limit(match_context, 10000); + pcre2_set_depth_limit(match_context, 1000); #else - pcre2_set_recursion_limit(match_context, 10000); + pcre2_set_recursion_limit(match_context, 1000); #endif #ifdef pcre2_set_heap_limit pcre2_set_heap_limit(match_context, 10); // units = kibibytes