-
-
Notifications
You must be signed in to change notification settings - Fork 0
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. 174: Log Injection #352
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: Yuniel Acosta Pérez <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: Yuniel Acosta Pérez <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: Yuniel Acosta Pérez <[email protected]>
…to autofix/alert-174-ba9eeb38e8
yacosta738
changed the title
Fix code scanning alert no. 174: Log Injection
fix :code scanning alert no. 174: Log Injection
Sep 30, 2024
yacosta738
changed the title
fix :code scanning alert no. 174: Log Injection
fix: code scanning alert no. 174: Log Injection
Sep 30, 2024
apps/backend/src/main/kotlin/com/lyra/app/users/infrastructure/http/UserRegisterController.kt
Fixed
Show fixed
Hide fixed
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #352 +/- ##
=======================================
Coverage 91.52% 91.53%
=======================================
Files 360 360
Lines 4344 4345 +1
Branches 374 374
=======================================
+ Hits 3976 3977 +1
Misses 237 237
Partials 131 131 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: Yuniel Acosta Pérez <[email protected]>
…to autofix/alert-174-ba9eeb38e8
yuniel-acosta
approved these changes
Sep 30, 2024
yacosta738
pushed a commit
that referenced
this pull request
Sep 30, 2024
## [1.14.1](v1.14.0...v1.14.1) (2024-09-30) ### Bug Fixes * code scanning alert no. 173: Log Injection [#351](#351) ([f527add](f527add)) * code scanning alert no. 174: Log Injection [#352](#352) ([b4a1013](b4a1013)) * code scanning alert no. 175: Log Injection ([#347](#347)) ([05a2c01](05a2c01)) * code scanning alert no. 317: Log Injection ([4537476](4537476))
yacosta738
pushed a commit
that referenced
this pull request
Sep 30, 2024
## [1.14.1](v1.14.0...v1.14.1) (2024-09-30) ### Bug Fixes * code scanning alert no. 173: Log Injection [#351](#351) ([f527add](f527add)) * code scanning alert no. 174: Log Injection [#352](#352) ([b4a1013](b4a1013)) * code scanning alert no. 175: Log Injection ([#347](#347)) ([05a2c01](05a2c01)) * code scanning alert no. 317: Log Injection ([4537476](4537476))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes https://github.com/dallay/lyra/security/code-scanning/174
To fix the log injection issue, we need to sanitize the user input before logging it. Specifically, we should remove any potentially dangerous characters, such as new-line characters, from the email address before including it in the log entry. This can be achieved by replacing such characters with safe alternatives or removing them entirely.
The best way to fix this problem without changing existing functionality is to sanitize the
registerUserRequest.email
value before logging it. We can use thereplace
method to remove new-line characters and other potentially dangerous characters.Suggested fixes powered by Copilot Autofix. Review carefully before merging.