The issue was addressed with improved checks. This issue is fixed in macOS Monterey 12.7, iOS 16.7 and iPadOS 16.7, iOS 17 and iPadOS 17, macOS Sonoma 14, macOS Ventura 13.6. An app may be able to access protected user data.
https://support.apple.com/en-us/HT213940
https://support.apple.com/en-us/HT213938
https://support.apple.com/en-us/HT213932