dallay / lyra

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

fix: code scanning alert no. 174: Log Injection #352

Closed yacosta738 closed 1 month ago

yacosta738 commented 1 month ago

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 the replace method to remove new-line characters and other potentially dangerous characters.

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

codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 91.53%. Comparing base (284aeb0) to head (f527add). Report is 10 commits behind head on main.

Additional details and impacted files ```diff @@ 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 ```

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