The vulnerability is a path traversal flaw specific to Windows environments where the Mako template engine is used. The root cause is an inconsistency in path separator handling between different parts of the library. The TemplateLookup.get_template function used posixpath to normalize template URIs, which treats backslashes (\) as regular characters, not path separators. However, the underlying file access check (os.path.isfile) on Windows correctly interprets backslashes as separators. This discrepancy allows an attacker to craft a URI like \..\..\secret.txt. The posixpath normalization in get_template and the startswith("..") check in Template.__init__ would fail to detect the traversal, but the filesystem would execute it, allowing the attacker to read files outside the designated template directory. The patch addresses this by explicitly replacing backslashes with forward slashes at the beginning of both TemplateLookup.get_template and Template.__init__, ensuring consistent path normalization across all platforms before any validation or file system operations occur.