Skip to content

Potential fix for code scanning alert no. 23: Log entries created from user input#18

Merged
akabarki76 merged 1 commit intotrunkfrom
alert-autofix-23
Jul 16, 2025
Merged

Potential fix for code scanning alert no. 23: Log entries created from user input#18
akabarki76 merged 1 commit intotrunkfrom
alert-autofix-23

Conversation

@akabarki76
Copy link
Copy Markdown
Owner

Potential fix for https://github.com/akabarki76/cli/security/code-scanning/23

To fix the issue, we need to sanitize the realIP value before logging it. Specifically, we should remove any newline (\n) or carriage return (\r) characters from the realIP string. This can be achieved using the strings.ReplaceAll function. The sanitization should be applied immediately after the realIP value is validated and before it is assigned to the logEvent.RealIP field.


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

…m user input

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@akabarki76 akabarki76 marked this pull request as ready for review July 16, 2025 01:10
@akabarki76 akabarki76 merged commit dafe4ab into trunk Jul 16, 2025
16 of 19 checks passed
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