Potential fix for code scanning alert no. 23: Clear-text logging of sensitive information#7
Conversation
…ensitive information Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated the warning message for short admin passwords in the authentication module from citing specific minimum length requirements to referencing password policy instead. No functional behavior changes; only warning text modified. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
k6 Performance Comparison
Gate (PR fail criteria)
Regressions detected: 6 Config source: |
Potential fix for https://github.com/TriForMine/nexis/security/code-scanning/23
In general, to fix clear-text logging issues, remove sensitive values from logs or replace them with generic messages that do not reveal secrets or detailed security configuration. If logs must indicate that something is misconfigured, they should do so without including actual secret-derived content or specific security parameters, or they should only include an internal error code.
For this particular case, the only tainted value is
minLengthderived fromcontext.password.config.minPasswordLength. We can keep the behavior (skipping admin bootstrap when the admin password is too short) while changing the log message so it no longer embeds the specific numeric minimum. A simple way is to log that the password is shorter than the required minimum without specifying the exact number. That removes the taintedminLengthfrom the log while preserving functionality. The comparison usingminLengthis still performed, but the value is no longer inserted into the string.Concretely, in
dashboard/control-api/src/better_auth.ts, update theconsole.warncall around line 138–140 to remove the(${minLength})interpolation and any wording that reveals the exact minimum. No new imports or helpers are needed.Suggested fixes powered by Copilot Autofix. Review carefully before merging.
Summary by CodeRabbit