Skip to content

Commit d4291ae

Browse files
author
claudiamurialdo
committed
CodeQL: Sanitize log entries created from user input
(cherry picked from commit 6359de6) # Conflicts: # dotnet/src/dotnetframework/GxClasses/Core/GXApplication.cs
1 parent 7f23992 commit d4291ae

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

dotnet/src/dotnetframework/GxClasses/Core/GXApplication.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3747,14 +3747,13 @@ internal string ClientTimeZoneId
37473747
if (!DateTimeUtil.ValidTimeZone(sTZ))
37483748
{
37493749
sTZ = (string)GetUndecodedCookie(GX_REQUEST_TIMEZONE);
3750-
GXLogging.Debug(Logger, "Try reading undecoded ClientTimeZone GX_REQUEST_TIMEZONE cookie:", sTZ);
3750+
GXLogging.DebugSanitized(Logger, "Try reading undecoded ClientTimeZone GX_REQUEST_TIMEZONE cookie:", sTZ);
37513751
}
37523752
try
37533753
{
37543754
if (!DateTimeUtil.ValidTimeZone(sTZ))
37553755
{
3756-
3757-
GXLogging.Warn(Logger, $"Time zone '{sTZ}' is unknown to source TZDB: {DateTimeZoneProviders.Tzdb.VersionId}.");
3756+
GXLogging.WarnSanitized(Logger, $"Time zone '{sTZ}' is unknown to source TZDB: {DateTimeZoneProviders.Tzdb.VersionId}.");
37583757
_currentTimeZoneId = DateTimeZoneProviders.Tzdb.GetSystemDefault().Id;
37593758
GXLogging.Warn(Logger, $"Setting Client timezone to System default: {_currentTimeZoneId}");
37603759
}

dotnet/src/dotnetframework/GxClasses/Data/GXDataCommon.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ protected static byte[] GetBinary(string fileNameParm, bool dbBlob)
940940
}
941941
break;
942942
default:
943-
GXLogging.Error(log, "Schema not supported: ", fileName);
943+
GXLogging.WarnSanitized(log, "Schema not supported: ", fileName);
944944
break;
945945
}
946946
GXLogging.Debug(log, "GetBinary fileName ", uri.AbsolutePath, ",ReadBytes:", binary != null ? binary.Length.ToString() : "0");

0 commit comments

Comments
 (0)