The vulnerability is a path traversal in DotVVM applications running in Debug mode when FileResourceLocation is used. The provided commit 68db0110beeda4e8e4be1b7c4e480ef876895bb5 patches this vulnerability by modifying the LocalResourceUrlManager.cs file.
The key change is within the TryLoadAlternativeFile method. Before the patch, this method took a name parameter (derived from the request URL) and used it to locate alternative files (e.g., source maps) without properly validating it for path traversal characters. This allowed an attacker to craft a URL that could access arbitrary files on the server, as the name parameter could contain sequences like ../.
The patch introduces a new helper method IsAllowedFileName which explicitly checks for path traversal characters (/, \\), leading dots, and invalid file name characters. The TryLoadAlternativeFile method now calls IsAllowedFileName at the beginning, and if the validation fails, it returns null, preventing the path traversal.
Therefore, DotVVM.Framework.ResourceManagement.LocalResourceUrlManager.TryLoadAlternativeFile is the vulnerable function because it processed potentially malicious input (name) and used it in file system operations without sufficient prior sanitization, leading to the path traversal vulnerability. The vulnerability is triggered when an attacker requests a resource, and the application, in Debug mode, attempts to find an alternative file (like a .map file) using this unsanitized name.