fix: bcrypt hash detected in 01__dump.sql...#5918
Conversation
…sh security vulnerability Automated security fix generated by Orbis Security AI
📝 WalkthroughWalkthroughThe SQL seed file has been updated to clear password hashes for two user accounts (demo/admin and user accounts), replacing previously hardcoded bcrypt values with empty strings. Inline comments were added indicating that passwords must be set after seeding. Changes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@store/seed/sqlite/01__dump.sql`:
- Around line 1-5: The seeded INSERT INTO user rows for usernames 'demo' and
'alice' set password_hash = '' which prevents bcrypt logins; either replace
those empty strings with a valid bcrypt hash for a documented bootstrap password
(e.g., generate a bcrypt hash for "changeme" and use that value for
password_hash) or stop inserting login-capable accounts by removing those INSERT
rows or marking them non-login (e.g., change role or add/clear a
must_reset/disabled flag). Update the two INSERT INTO user lines for 'demo' and
'alice' to use the chosen approach so password_hash is not an empty string.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4d14b496-43af-4b9b-9021-fbd38c829427
📒 Files selected for processing (1)
store/seed/sqlite/01__dump.sql
| -- Demo User (Admin) — password must be set after seeding | ||
| INSERT INTO user (id,username,role,nickname,password_hash) VALUES(1,'demo','ADMIN','Demo User',''); | ||
|
|
||
| -- Alice (User) — password: demo | ||
| INSERT INTO user (id,username,role,nickname,description,password_hash) VALUES(2,'alice','USER','Alice','Developer & avid reader 📚','$2a$10$c.slEVgf5b/3BnAWlLb/vOu7VVSOKJ4ljwMe9xzlx9IhKnvAsJYM6'); | ||
| -- Alice (User) — password must be set after seeding | ||
| INSERT INTO user (id,username,role,nickname,description,password_hash) VALUES(2,'alice','USER','Alice','Developer & avid reader 📚',''); |
There was a problem hiding this comment.
Do not leave seeded users with empty password hashes.
password_hash = '' makes both accounts fail bcrypt login, so fresh seeds will create demo and alice rows that cannot authenticate at all. If these accounts are still meant to be usable, this needs a real bootstrap password/reset path; otherwise they should not be inserted as login-capable users.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@store/seed/sqlite/01__dump.sql` around lines 1 - 5, The seeded INSERT INTO
user rows for usernames 'demo' and 'alice' set password_hash = '' which prevents
bcrypt logins; either replace those empty strings with a valid bcrypt hash for a
documented bootstrap password (e.g., generate a bcrypt hash for "changeme" and
use that value for password_hash) or stop inserting login-capable accounts by
removing those INSERT rows or marking them non-login (e.g., change role or
add/clear a must_reset/disabled flag). Update the two INSERT INTO user lines for
'demo' and 'alice' to use the chosen approach so password_hash is not an empty
string.
Summary
Fix high severity security issue in
store/seed/sqlite/01__dump.sql.Vulnerability
generic.secrets.security.detected-bcrypt-hash.detected-bcrypt-hashstore/seed/sqlite/01__dump.sql:2Description: bcrypt hash detected
Changes
store/seed/sqlite/01dump.sqlVerification
Automated security fix by OrbisAI Security