This issue was addressed with improved checks. This issue is fixed in macOS Monterey 12.4. An attacker may be able to cause unexpected application termination or arbitrary code execution.
https://support.apple.com/kb/HT213258
https://support.apple.com/kb/HT213254