The issue was addressed with improved checks. This issue is fixed in visionOS 1.2, macOS Sonoma 14.5, iOS 17.5 and iPadOS 17.5. Processing a maliciously crafted image may lead to arbitrary code execution.
https://support.apple.com/kb/HT214108
https://support.apple.com/kb/HT214106
https://support.apple.com/kb/HT214101
https://support.apple.com/en-us/HT214108
https://support.apple.com/en-us/HT214106