The vulnerability is a classic relative path traversal in the Apache Ignite REST API's log handling functionality. The analysis of the patch commit 5c42c7a303937844179ad470edb35c1ad1cee6ab clearly pinpoints the flaw and the fix. The core of the vulnerability is in the GridLogCommandHandler.java file, specifically within the handleAsync method. Previously, this method validated the user-provided log file path by simply checking if it started with the igniteHome directory path. This is a common but flawed approach, as it can be bypassed using directory traversal notations like .. or their URL-encoded equivalents (%2e%2e).
The patch introduces a new private static method, resolveFilePath, which properly sanitizes the input path. This method normalizes the URI to resolve encoded characters and then gets the canonical path of the file, which resolves any .. sequences. The handleAsync method was updated to use this new sanitization function before performing the security check, thus ensuring that the path is confined within the intended directory. The vulnerable function is therefore org.apache.ignite.internal.processors.rest.handlers.log.GridLogCommandHandler.handleAsync, as it was the entry point for processing the malicious user input.