Repository navigation
v0.12.1
A security release. It fixes two ways to inject SQL through ddk-mybatis and ddk-mybatis-starter: the sort field of a page query, and a string tenant id. Every application that accepts a PageQuery from a request should upgrade; applications with string tenant ids should upgrade too. Nothing else changes, and nothing needs to change in the application. The advisories are GHSA-67m2-4mxv-mj3p and GHSA-3wwm-gcpx-5ch7.
Security
- A sort field of a page query can no longer inject SQL.
QueryParserpassedSort.sortFieldto MyBatis-Plus'sorderBy, which puts the column intoORDER BYas it is, so a controller that accepts aPageQueryin its request body let the caller run a subquery in the database. A sort field must now be an identifier ([A-Za-z_][A-Za-z0-9_]*); anything else fails withVALIDATION_ERROR, which the web starter answers with 400. Affects every release since the first one - A string tenant id can no longer inject SQL. With
ddk.mybatis.tenant.numeric-id=false, the tenant was written into the tenant condition without escaping, so a tenant id with a quote read the rows of every tenant. Tenant ids can come from a gateway header or the unsignedddk-event-tenantmessage header. A string tenant id that contains a quote, a backslash or a control character is now rejected before any SQL runs. Numeric tenant ids, the default, were not affected