The vulnerability is a path traversal in the python-multipart library, identified as GHSA-wp53-j4wj-2cfg. The root cause is the improper handling of filenames in the File class constructor (__init__). When a file is uploaded with a specially crafted filename (e.g., /etc/passwd) and specific non-default settings are enabled (UPLOAD_DIR and UPLOAD_KEEP_FILENAME=True), the library fails to sanitize the filename. The File.__init__ method directly processes the filename without removing directory traversal characters. The patch 9433f4bbc9652bdde82bbe380984e32f8cfc89c4 introduces a call to os.path.basename() within File.__init__ to strip any directory information from the filename, thus mitigating the vulnerability. Therefore, File.__init__ is the vulnerable function where the malicious input is processed and made ready for exploitation, which is then triggered by the write method.