Chat2DB (they call it an "AI-driven database tool" because everything is AI now) has an input validation problem in ai/chat2db/server/web/api/controller/data/source/DataSourceController.java
. How is it 2025 and we're still seeing unparameterized queries? Affects 0.3.7 and older versions, but double-check their releases because I'm not their release manager.
What's Actually Broken
When you set up database connections in Chat2DB, it doesn't properly validate what you put in the connection parameters. Someone could stuff SQL commands in there and they'd get executed. I've exploited this exact bug pattern in like three different database tools this year - always the same story: developers concatenating user input because parameterized queries are "too complicated" until someone owns their entire database. Had a similar thing happen with some database tool a few months back. Took forever to figure out it was the connection form, and of course it broke staging right before a demo.
The CVE entry lists it as network exploitable, which means anyone on your network can potentially pwn your databases. Really bad news if you've exposed Chat2DB to the internet.
Impact If You're Running This Thing
If you've got Chat2DB hooked up to production databases, an attacker could potentially:
- Pull data from whatever databases you've connected
- Mess with records if your database user has write permissions
- Escalate privileges depending on your database setup
This bug doesn't discriminate - MySQL, PostgreSQL, Oracle - it'll fuck them all equally. Since Chat2DB is basically a central hub for database access, getting pwned through it is worse than a single database compromise. It's like leaving your house keys in the front door with a note saying "please rob me."
Who Needs to Worry
Anyone running vulnerable versions, which I think is 0.3.7 and below. This includes:
- Docker deployments (probably most common)
- Local installations on dev machines
- Production instances (hopefully you didn't expose these to the internet)
I haven't seen active exploitation in the wild yet, but SQL injection vulnerabilities don't stay quiet for long once they're public.