Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASM] Log FormatException from get_Uri as debug #6489

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public static UriBuilder Init(string uriText)
{
PropagationModuleImpl.PropagateWholeResultWhenInputTainted(result.Uri.OriginalString, uriText);
}
catch (FormatException ex)
{
IastModule.Log.Debug(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(SetQuery)}");
}
catch (Exception ex)
{
IastModule.Log.Error(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(Init)}");
Expand All @@ -51,6 +55,10 @@ public static UriBuilder Init(Uri uri)
{
PropagationModuleImpl.PropagateWholeResultWhenInputTainted(result.Uri.OriginalString, uri.OriginalString);
}
catch (FormatException ex)
{
IastModule.Log.Debug(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(SetQuery)}");
}
catch (Exception ex)
{
IastModule.Log.Error(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(Init)}");
Expand All @@ -73,6 +81,10 @@ public static UriBuilder Init(string scheme, string host)
{
PropagationModuleImpl.PropagateWholeResultWhenInputTainted(result.Uri.OriginalString, host);
}
catch (FormatException ex)
{
IastModule.Log.Debug(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(SetQuery)}");
}
catch (Exception ex)
{
IastModule.Log.Error(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(Init)}");
Expand All @@ -96,6 +108,10 @@ public static UriBuilder Init(string scheme, string host, int port)
{
PropagationModuleImpl.PropagateWholeResultWhenInputTainted(result.Uri.OriginalString, host);
}
catch (FormatException ex)
{
IastModule.Log.Debug(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(SetQuery)}");
}
catch (Exception ex)
{
IastModule.Log.Error(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(Init)}");
Expand All @@ -120,6 +136,10 @@ public static UriBuilder Init(string scheme, string host, int port, string path)
{
PropagationModuleImpl.PropagateWholeResultWhenInputTainted(result.Uri.OriginalString, host, path);
}
catch (FormatException ex)
{
IastModule.Log.Debug(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(SetQuery)}");
}
catch (Exception ex)
{
IastModule.Log.Error(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(Init)}");
Expand All @@ -145,6 +165,10 @@ public static UriBuilder Init(string scheme, string host, int port, string path,
{
PropagationModuleImpl.PropagateWholeResultWhenInputTainted(result.Uri.OriginalString, host, path, extra);
}
catch (FormatException ex)
{
IastModule.Log.Debug(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(SetQuery)}");
}
catch (Exception ex)
{
IastModule.Log.Error(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(Init)}");
Expand All @@ -166,6 +190,10 @@ public static void SetHost(UriBuilder instance, string parameter)
{
PropagationModuleImpl.PropagateWholeResultWhenInputTainted(instance.Uri.OriginalString, parameter);
}
catch (FormatException ex)
{
IastModule.Log.Debug(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(SetQuery)}");
}
catch (Exception ex)
{
IastModule.Log.Error(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(Init)}");
Expand All @@ -185,6 +213,10 @@ public static void SetQuery(UriBuilder instance, string parameter)
{
PropagationModuleImpl.PropagateWholeResultWhenInputTainted(instance.Uri.OriginalString, parameter);
}
catch (FormatException ex)
{
IastModule.Log.Debug(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(SetQuery)}");
}
catch (Exception ex)
{
IastModule.Log.Error(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(SetQuery)}");
Expand All @@ -204,6 +236,10 @@ public static void SetPath(UriBuilder instance, string parameter)
{
PropagationModuleImpl.PropagateWholeResultWhenInputTainted(instance.Uri.OriginalString, parameter);
}
catch (FormatException ex)
{
IastModule.Log.Debug(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(SetQuery)}");
}
catch (Exception ex)
{
IastModule.Log.Error(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(SetPath)}");
Expand All @@ -223,6 +259,10 @@ public static string GetHost(UriBuilder instance)
{
PropagationModuleImpl.PropagateWholeResultWhenInputTainted(result, instance.Uri.OriginalString);
}
catch (FormatException ex)
{
IastModule.Log.Debug(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(SetQuery)}");
}
catch (Exception ex)
{
IastModule.Log.Error(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(GetHost)}");
Expand All @@ -244,6 +284,10 @@ public static string GetQuery(UriBuilder instance)
{
PropagationModuleImpl.PropagateWholeResultWhenInputTainted(result, instance.Uri.OriginalString);
}
catch (FormatException ex)
{
IastModule.Log.Debug(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(SetQuery)}");
}
catch (Exception ex)
{
IastModule.Log.Error(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(GetQuery)}");
Expand All @@ -265,6 +309,10 @@ public static string GetPath(UriBuilder instance)
{
PropagationModuleImpl.PropagateWholeResultWhenInputTainted(result, instance.Uri.OriginalString);
}
catch (FormatException ex)
{
IastModule.Log.Debug(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(SetQuery)}");
}
catch (Exception ex)
{
IastModule.Log.Error(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(GetPath)}");
Expand All @@ -287,6 +335,10 @@ public static string GetPath(UriBuilder instance)
{
PropagationModuleImpl.PropagateWholeResultWhenInputTainted(result, (instance as UriBuilder)?.Uri?.OriginalString);
}
catch (FormatException ex)
{
IastModule.Log.Debug(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(SetQuery)}");
}
catch (Exception ex)
{
IastModule.Log.Error(ex, $"Error invoking {nameof(UriBuilderAspect)}.{nameof(ToString)}");
Expand Down
Loading