Hey @Paul.Spain, I’ve taken the liberty to move this post to the false positive/false negative category. As per that category’s template, could you please provide:
What language is this for? (okay, you did tell us this one: it’s C#)
Which rule? (rule ID, please)
Why do you believe it’s a false-positive/false-negative? (you mostly also elaborated on this one, no need to reiterate)
Are you using
SonarQube Cloud?
SonarQube Server / Community Build - which version?
SonarQube for IDE - which IDE/version?
in connected mode with SonarQube Server / Community Build or SonarQube Cloud?
How can we reproduce the problem? Give us a self-contained snippet of code (formatted text, no screenshots)
Good morning,
Ah, sorry about the category, I placed it in the category suggested by your site AI.
What language is this for? (okay, you did tell us this one: it’s C#) C# inside an ASP.net Core product
Which rule
Roslyn.sonaranalyzer.security.cs:S5145
Cwe
Why do you believe it’s a false-positive/false-negative? (you mostly also elaborated on this one, no need to reiterate)
The detection is correct in that I am logging user data to the log file.
However the data in question is a type safe GUID. Coming from a model that is populated from a post.
As the data is of GUID form, I think it is unreasonable to flag this as an issue.
For example there is no such issue when logging user created numbers into the log.
Are you using
Enterprise Edition v2025.4.4 (119049)
How can we reproduce the problem? Give us a self-contained snippet of code (formatted text, no screenshots)
Class Model
{
public GUID MyGuid;
}
[HttpPost]
public ActionResult<model> Post (Model model)
{
_logger.LogInformation(model.MyGuid);
}
This is a very stripped down version of what I have, but should be enough for you to recreate the issue.
I think I agree that logging a specific GUID is not a security risk in most cases. I’m curious to know why this case is flagged, as I assume there is a good rational behind it.