The issue was addressed with improved checks. This issue is fixed in macOS Sequoia 15, macOS Sonoma 14.7.1, macOS Ventura 13.7.1. An attacker with physical access may be able to share items from the lock screen.
https://support.apple.com/en-us/121570
https://support.apple.com/en-us/121568
https://support.apple.com/en-us/121238