Skip to content

Commit

Permalink
Remove line breaks from user log input to prevent log forging (#987)
Browse files Browse the repository at this point in the history
  • Loading branch information
danjov authored Jan 26, 2024
2 parents 5f4b6d7 + 9e8770a commit d45742a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/Authentication/LegacyApiAuthenticationMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public async Task InvokeAsync(HttpContext context, RequestDelegate next)

await next.Invoke(context).ConfigureAwait(false);

logger.LogInformation("Authorized user with subject_id <{SubjectId}> for legacy api accessing route <{Route}>", subjectId.Value, context.Request.Path);
var route = context.Request.Path.ToString().ReplaceLineEndings("");
logger.LogInformation("Authorized user with subject_id <{SubjectId}> for legacy api accessing route <{Route}>", subjectId.Value, route);
return;
}
}
Expand Down

0 comments on commit d45742a

Please sign in to comment.