From ce6b3bd1248d863ff8ad720efd79bf0efaecdd1c Mon Sep 17 00:00:00 2001 From: Ahson Khan Date: Thu, 4 Apr 2024 15:04:15 -0700 Subject: [PATCH] Strengthen the client_secret sanitizer regex (#5474) * Strengthen the client_secret sanitizer regex * clang-format update --- sdk/core/azure-core-test/src/test_proxy_manager.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sdk/core/azure-core-test/src/test_proxy_manager.cpp b/sdk/core/azure-core-test/src/test_proxy_manager.cpp index 6d21f0909..9e7d0bae6 100644 --- a/sdk/core/azure-core-test/src/test_proxy_manager.cpp +++ b/sdk/core/azure-core-test/src/test_proxy_manager.cpp @@ -241,10 +241,7 @@ void TestProxyManager::SetProxySanitizer() }; addSanitizer(SanitizerType::General, g_accountRegex, "account"); - addSanitizer( - SanitizerType::Body, - "client_secret=(?[a-zA-Z0-9\\%_~\\-\\.]+)", - "clientsecret"); + addSanitizer(SanitizerType::Body, "client_secret=(?[^&]+)", "clientsecret"); const std::string storageSasSignatureRegex = "\\?.*sig=(?[a-zA-Z0-9\\%\\/+=]+)"; addSanitizer(SanitizerType::Uri, storageSasSignatureRegex, "sassig"); addSanitizer(SanitizerType::Header, storageSasSignatureRegex, "sassig", "x-ms-copy-source");