The vulnerability exists in the safe_join function located in src/werkzeug/security.py. This function did not properly sanitize user-provided filenames to prevent the use of reserved Windows device names such as 'CON', 'AUX', or 'PRN'. The patch, found in commit 4b833376a45c323a189cd11d2362bcffdb1c0c13, adds a specific check for these device names when the operating system is Windows (os.name == 'nt'). The vulnerability is typically exploited through the send_from_directory function, which uses safe_join to construct the path to the file being served. By requesting a file with a special device name, an attacker can cause the application to hang when send_from_directory attempts to read from the device, leading to a Denial of Service. A runtime profile of an exploit would show send_from_directory calling the vulnerable safe_join function.