From 663e5f2e33951f9dc96f16333f6a88eab968662c Mon Sep 17 00:00:00 2001 From: Arunan Sugunakumar Date: Mon, 25 Sep 2023 15:14:59 +0530 Subject: [PATCH] Update the URL pattern regex to correctly mask the SMB2 passwords --- .../main/java/org/apache/synapse/commons/vfs/VFSUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/commons/src/main/java/org/apache/synapse/commons/vfs/VFSUtils.java b/modules/commons/src/main/java/org/apache/synapse/commons/vfs/VFSUtils.java index 9025114ec6..c28af296cb 100644 --- a/modules/commons/src/main/java/org/apache/synapse/commons/vfs/VFSUtils.java +++ b/modules/commons/src/main/java/org/apache/synapse/commons/vfs/VFSUtils.java @@ -67,7 +67,7 @@ public class VFSUtils { /** * URL pattern */ - private static final Pattern URL_PATTERN = Pattern.compile("[a-z]+://.*"); + private static final Pattern URL_PATTERN = Pattern.compile("[a-zA-Z0-9]+://.*"); /** * Password pattern @@ -350,7 +350,7 @@ public static String maskURLPassword(String url) { String maskUrl; if (urlMatcher.find()) { final Matcher pwdMatcher = PASSWORD_PATTERN.matcher(url); - maskUrl = pwdMatcher.replaceFirst("\":***@\""); + maskUrl = pwdMatcher.replaceFirst(":***@"); return maskUrl; } return url;