This issue was addressed with improved file handling. This issue is fixed in macOS Ventura 13.4, tvOS 16.5, iOS 16.5 and iPadOS 16.5, watchOS 9.5. An app may be able to gain root privileges.
https://support.apple.com/kb/HT213764
https://support.apple.com/kb/HT213761
https://support.apple.com/kb/HT213758
https://support.apple.com/kb/HT213757
https://support.apple.com/en-us/HT213764
https://support.apple.com/en-us/HT213761