Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code scanning alert no. 320: Log entries created from user input #459

Closed
wants to merge 1 commit into from

Conversation

ChaosEngine
Copy link
Owner

Fixes https://github.com/ChaosEngine/Dotnet-Playground/security/code-scanning/320

To fix the problem, we need to sanitize the sql variable before logging it. Since the log entries are plain text, we should remove any newline characters from the sql string to prevent log forgery. This can be done using the Replace method to remove newline characters.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@ChaosEngine ChaosEngine closed this Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant