Class LogSanitizer
- Namespace
- Fdyay.IdentityServer.Hosting
- Assembly
- Fdyay.IdentityServer.AspNetCore.dll
Makes an attacker-supplied protocol value safe to hand to a log sink.
public static class LogSanitizer
- Inheritance
-
LogSanitizer
- Inherited Members
Remarks
Values such as the requested redirect URI arrive unvalidated on the failing request, so a sink that renders raw text could otherwise be talked into a second, forged log line. Control characters — CR and LF among them — are removed and the result is capped, so what reaches the sink is always a single bounded line.
Fields
MaxLength
The longest value handed to a sink; longer values are truncated.
public const int MaxLength = 200
Field Value
Methods
Sanitize(string?)
Strips control characters and truncates to MaxLength.
public static string? Sanitize(string? value)
Parameters
valuestring