Skip to content

Commit

Permalink
Fix code scanning alert no. 12: Log entries created from user input
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
neozhu and github-advanced-security[bot] authored Dec 15, 2024
1 parent 77c7c60 commit e230e98
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ public static IEndpointRouteBuilder MapIdentityApiAdditionalEndpoints<TUser>(thi
{
return CreateValidationProblem(result);
}
logger.LogInformation("User signup successful. Email: {Email}, TenantId: {TenantId}", request.Email, request.TenantId);
var sanitizedEmail = request.Email.Replace(Environment.NewLine, "").Replace("\n", "").Replace("\r", "");
var sanitizedTenantId = request.TenantId.Replace(Environment.NewLine, "").Replace("\n", "").Replace("\r", "");
logger.LogInformation("User signup successful. Email: {Email}, TenantId: {TenantId}", sanitizedEmail, sanitizedTenantId);

Check warning

Code scanning / CodeQL

Exposure of private information Medium

Private data returned by
access to local variable sanitizedEmail
is written to an external location.
await SendConfirmationEmailAsync(user, userManager, context, request.Email);
return TypedResults.Created();
})
Expand Down

0 comments on commit e230e98

Please sign in to comment.