The vulnerability is a path confusion issue in FrankenPHP's CGI path splitting logic, caused by improper handling of Unicode characters. The root cause lies in the frankenphp.splitPos function located in cgi.go. This function used strings.ToLower() on the entire request path to find the position of a script extension (e.g., .php). However, for certain Unicode characters, their lowercase representation has a different byte length than the original character. This discrepancy caused splitPos to return a byte index that was correct for the lowercased string but incorrect for the original path string.
The vulnerability is triggered in the frankenphp.splitCgiPath function, which consumes this incorrect index to split the original path into SCRIPT_NAME and PATH_INFO. This could cause the server to treat a larger portion of the path as the script to be executed, leading to a scenario where a non-PHP file (e.g., a user-uploaded text file) could be executed as a PHP script, resulting in Remote Code Execution (RCE).
The patch resolves this by completely rewriting the splitPos function. The new implementation avoids strings.ToLower() on the whole path. Instead, it iterates through the path and performs a manual, case-insensitive comparison for ASCII characters, and uses a dedicated library (golang.org/x/text/search) for safe, case-insensitive matching of non-ASCII characters. This ensures the returned index is always correct for the original path string. Additionally, the frankenphp.WithRequestSplitPath function was hardened to reject non-ASCII characters in the split path specifiers.