hintwatermelon / WebGoat.NET

OWASP WebGoat.NET
0 stars 0 forks source link

✨ (sonar) Fixed finding: "Logging templates should be constant" #3

Open pixeebot-dan-helm[bot] opened 1 week ago

pixeebot-dan-helm[bot] commented 1 week ago

✨✨✨

Remediation

This change fixes "Logging templates should be constant" (id = csharpsquid:S2629) identified by sonar.

Details

Using string formatting or concatenation for log messages can lead to performance issues and, in extreme cases, potential security risks, such as log injection. The fix involves using templated log messages, which improve performance by deferring message construction until necessary and enhance security by preventing unintended data interpolation.

I have additional improvements ready for this repo! If you want to see them, leave the comment:

@pixeebot next

... and I will open a new PR right away!

🧚🤖 Powered by Pixeebot Enhanced with AI Learn more

Feedback | Community | Docs | Codemod ID: sonar:dotnet/templated-logging

dunningdan commented 1 week ago

@pixee next