packages/stats/core/drizzle.config.ts disables TLS certificate verification for the stats MySQL connection
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 66/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- bun, mysql, typescript
Research direction
Read packages/stats/core/drizzle.config.ts and the db:generate, db:push, and db:studio scripts in packages/stats/core/package.json. Confirm which CA the stats database uses, then run bun run --cwd packages/stats/core db:studio or db:generate with verification enabled. Done means the tooling verifies the database certificate and connects successfully.
Written by the indexing model from the issue text.
Description
Summary
packages/stats/core/drizzle.config.ts sets rejectUnauthorized: false in its MySQL ssl options (lines 16-18). The db:generate, db:push and db:studio scripts in packages/stats/core/package.json use this config, so the connection to the stats database skips server certificate verification whenever those scripts run.
Why it matters
A connection that skips certificate verification will accept any certificate presented by the server. Someone positioned on the network path between the machine running these scripts and the database could impersonate the database, read or alter the traffic, and capture the database credentials that the config reads from SST resources. Real-world exposure depends on where these scripts run and how the database is reached, which is why this is a hardening request rather than a confirmed exploit.
Suggested change
- Remove
rejectUnauthorized: false, so verification is on by default. - If the database uses a private or self-signed CA, configure that CA explicitly (for example, a
cavalue read from a resource), rather than disabling verification.
How to check
Confirm that the stats database presents a certificate issued by a CA the tooling trusts, then run bun run --cwd packages/stats/core db:studio or db:generate with verification enabled.
Notes
- Found with static analysis; the connection was not exercised.
- No CI job invokes this config directly, as far as the repository shows.
- Dominant language
- TypeScript
- Stars
- 221k
- Forks
- 29.6k
- Avg merge
- 4h 55m
- Merged PRs (30d)
- 500
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anomalyco/opencode
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
anomalyco/opencode#59826 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anomalyco/opencode#59677 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
anomalyco/opencode#59589 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
anomalyco/opencode#59557 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
anomalyco/opencode#59302 · 1 comment ·
Maintainers usually reply within 1 day
All issues in anomalyco/opencode
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
scaleway/ultraviolet#7089 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
tencent-connect/dsh-qqbot#81 ·
Maintainers usually reply within 1 day
-
[Bug]: Pen taps on sidebar rows start a drag and lose their clickPossibly taken @makhnatkin claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
clangd/vscode-clangd#1009 ·