This issue was addressed with additional entitlement checks. This issue is fixed in macOS Sonoma 14.7.1, macOS Ventura 13.7.1. A malicious application may be able to leak a user's credentials.
https://wts.dev/posts/password-leak/
https://support.apple.com/en-us/121570