dallay / lyra

SMRO
https://lyra-nwhm.onrender.com
1 stars 0 forks source link

fix: code scanning alert no. 173: Log Injection #351

Closed yacosta738 closed 1 month ago

yacosta738 commented 1 month ago

Fixes https://github.com/dallay/lyra/security/code-scanning/173

To fix the log injection issue, we need to sanitize the user input before logging it. Specifically, we should remove any newline characters from the email address to prevent log injection attacks. This can be achieved by replacing newline characters with an empty string.

  1. Modify the registerNewUser method in UserRegistrator.kt to sanitize the registerUserCommand.email before logging it.
  2. Add a utility function to sanitize the input by removing newline characters.
  3. Ensure that the logging statement uses the sanitized email.

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

github-actions[bot] commented 1 month ago

Job Summary for Gradle

Commit Stage 🤖 :: code-coverage

Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
lyra koverXmlReport 8.7 :x: Build Scan published
lyra projects 8.7 :white_check_mark: Build Scan published
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.52%. Comparing base (284aeb0) to head (67daac0). Report is 10 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #351 +/- ## ======================================= Coverage 91.52% 91.52% ======================================= Files 360 360 Lines 4344 4344 Branches 374 374 ======================================= Hits 3976 3976 Misses 237 237 Partials 131 131 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.