This issue was addressed with improved checks This issue is fixed in iOS 17.5 and iPadOS 17.5, macOS Sonoma 14.5. An app may be able to bypass Privacy preferences.
https://support.apple.com/kb/HT214107
https://support.apple.com/kb/HT214106
https://support.apple.com/kb/HT214105
https://support.apple.com/kb/HT214101
https://support.apple.com/kb/HT214100
https://support.apple.com/en-us/HT214106
https://support.apple.com/en-us/HT214101