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. 3: Log Injection #28

Merged
merged 1 commit into from
Sep 28, 2024

Conversation

shulng
Copy link
Contributor

@shulng shulng commented Sep 28, 2024

Fixes https://github.com/zhinghu/CatSeedLogin/security/code-scanning/3

To fix the log injection issue, we need to sanitize the playerName before logging it. The best way to do this is to remove any potentially harmful characters, such as new-line characters, from the playerName. This can be achieved using the replace method to replace such characters with a safe alternative.

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>
@shulng shulng marked this pull request as ready for review September 28, 2024 15:10
@shulng shulng merged commit 1dd7e2b into main Sep 28, 2024
3 checks passed
@shulng shulng deleted the autofix/alert-3-72f8c00e97 branch October 14, 2024 10:00
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