Skip to content

Security: Hardcoded Database Path in Drizzle Config#882

Open
tuanaiseo wants to merge 1 commit into
XiaomiMiMo:mainfrom
tuanaiseo:contribai/fix/security/hardcoded-database-path-in-drizzle-confi
Open

Security: Hardcoded Database Path in Drizzle Config#882
tuanaiseo wants to merge 1 commit into
XiaomiMiMo:mainfrom
tuanaiseo:contribai/fix/security/hardcoded-database-path-in-drizzle-confi

Conversation

@tuanaiseo

Copy link
Copy Markdown

Problem

The drizzle.config.ts file contains a hardcoded absolute database path '/home/thdxr/.local/share opencode/opencode.db' in the dbCredentials.url field. This exposes a developer's personal system path and will cause failures when deployed or used on other machines. The path should be configurable via environment variables.

Severity: medium
File: packages/opencode/drizzle.config.ts

Solution

Replace the hardcoded path with an environment variable fallback, e.g., url: process.env.DATABASE_URL ?? './opencode.db'

Changes

  • packages/opencode/drizzle.config.ts (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

The drizzle.config.ts file contains a hardcoded absolute database path '/home/thdxr/.local/share opencode/opencode.db' in the dbCredentials.url field. This exposes a developer's personal system path and will cause failures when deployed or used on other machines. The path should be configurable via environment variables.

Affected files: drizzle.config.ts

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant