The vulnerability is a blind SQL injection in Craft Commerce, specifically within the product and variant element queries. The root cause is that the hasVariant property on ProductQuery and the hasProduct property on VariantQuery did not sanitize their input before using it to configure a sub-query. A previous fix for a similar vulnerability (GHSA-2453-mppf-46cj) only sanitized top-level query properties, but these nested properties bypassed the blocklist.
An authenticated control panel user could exploit this by sending a crafted request to endpoints that use these queries, such as the element listing pages (/admin/commerce/products). By embedding a malicious SQL statement in the where parameter of the hasVariant or hasProduct criteria (e.g., criteria[hasVariant][where]=...SQL...), they could execute arbitrary SQL queries.
The patch addresses this by introducing a new helper method, craft\commerce\helpers\ProductQueryHelper::cleanseQueryCriteria(). This method is now called within _applyHasVariantParam and _applyHasProductParam to sanitize the criteria array before it's passed to Craft::configure(). The cleanseQueryCriteria method, in turn, leverages Craft CMS's core ElementHelper::cleanseQueryCriteria if the request is coming from a relevant controller (like ElementIndexesController), effectively stripping out dangerous keys like where and orderBy from the user-provided criteria and preventing the injection.