The vulnerability, as described, is a policy bypass in the -script operation of ImageMagick. The analysis of the provided patch e047ee2c7b937c1db92302fe3701e2e9c169de27 confirms this. The patch adds a security policy check to the AcquireScriptTokenInfo function in MagickWand/script-token.c. This function is directly related to the -script operation. The added code explicitly checks if the provided filename is authorized for reading using IsPathAuthorized. The absence of this check in the vulnerable versions allowed for the policy bypass. Therefore, the AcquireScriptTokenInfo function is the vulnerable function, as it was the entry point for processing the malicious input (the script filename) without proper validation.