Tianji
Tianji: SQL Injection via unsanitized timezone parameter in analytics queries
Tianji is an open source analytics, uptime monitoring, and server status platform. Prior to 1.31.29, the getDateQuery() function in src/server/utils/prisma.ts constructs raw SQL through Prisma.sql() by interpolating the timezone request value without parameter binding. The timezone value can reach affected analytics queries through request data or the timezone HTTP header, and workspaceProcedure permits any authenticated workspace member, including a read-only viewer, to reach those queries. An attacker can execute arbitrary SQL against the shared PostgreSQL database, which can disclose or modify credentials, API keys, and tenant data or make the service unavailable. This issue is fixed in version 1.31.29.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 1.31.29
Fixed in 1.31.29
Mitigation
Upgrade tianji to 1.31.29 or later.
References
- Vendor advisory github.com/msgbyte/tianji/security/advisories/…
- Patch github.com/msgbyte/tianji/commit/132ff67907df8…
- Release notes github.com/msgbyte/tianji/releases/tag/v1.31.2…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.