The vulnerability, CVE-2025-3602, concerns the lack of GraphQL query depth limitation in Liferay Portal, which could lead to Denial of Service (DoS) attacks. The provided commit 6c6dad38c9c891ad58cdee9deb2e35432d7e8816 introduces a fix for this issue.
The primary change occurs in the GraphQLServletExtender.java file, specifically within the _createServlet method. This method is responsible for setting up the GraphQL servlet, including its query execution mechanism (GraphQLQueryInvoker).
Before the patch, the GraphQLQueryInvoker was initialized without any instrumentation to limit the depth of incoming GraphQL queries. The patch modifies the _createServlet method to include MaxQueryDepthInstrumentation (a new class added by the patch) when building the GraphQLQueryInvoker. This new instrumentation is responsible for enforcing a configurable query depth limit, obtained via _getMaxQueryDepthInstrumentation which reads from HeadlessAPICompanyConfiguration.
Therefore, the _createServlet method, in its pre-patch state, was the point where the vulnerable configuration (i.e., lack of depth limiting) was established. When a GraphQL query is processed, it goes through the servlet configured by this method. If an attacker sends an overly complex (deeply nested) query, the unconstrained execution would lead to excessive resource consumption, causing a DoS. The _createServlet function is thus identified as the key function that, by its previous definition, allowed the vulnerable behavior.